Solana instructions › Raydium CPMM (CP Swap) › swap_base_output
Raydium CPMM (CP Swap) instruction. Program ID CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C. Position in this snapshot: 6.
Discriminator or tag: 0x37d96256a34ab4ad — published in the IDL snapshot.
Swap the tokens in the pool base output amount # Arguments * `ctx`- The context of accounts * `max_amount_in` - input amount prevents excessive slippage * `amount_out` - amount of output token
| # | Account | Role |
|---|---|---|
| 0 | payer | signer |
| 1 | authority | read-only |
| 2 | amm_config | read-only |
| 3 | pool_state | writable |
| 4 | input_token_account | writable |
| 5 | output_token_account | writable |
| 6 | input_vault | writable |
| 7 | output_vault | writable |
| 8 | input_token_program | read-only |
| 9 | output_token_program | read-only |
| 10 | input_token_mint | read-only |
| 11 | output_token_mint | read-only |
| 12 | observation_state | writable |
| Argument | Type |
|---|---|
| max_amount_in | u64 |
| amount_out | u64 |
To see which instructions a confirmed transaction actually ran, paste its signature into the Rugsight transaction explainer.
Instruction lists and published discriminators come from solana-idls@1.2.1 (MIT) and, for the System Program, Compute Budget and Associated Token Account programs, from their public instruction enums (Apache-2.0). Snapshot date 2026-11-17. Programs can upgrade, so a live program may differ from this snapshot. Computed Anchor discriminators are the first 8 bytes of sha256("global:<snake_case_name>") and are labelled as computed.