Skip to main content
The cp-amm IDL exposes many instructions. Integrators can choose to either use the TypeScript SDK for transaction construction or build through CPI.

Pool Creation

Pool creation initializes the pool, vaults, first position, and Token-2022 position NFT. Pool PDAs sort mints in the seed list, but transaction builders should use the canonical token_a_mint and token_b_mint fields from pool state after creation.

Positions

Position ownership is checked through the position NFT token account. The token account must hold exactly one NFT and be owned by the signer.

Liquidity And Locks

Add and remove liquidity update pool rewards, position rewards, fees, reserves, and liquidity before transferring tokens.

Swaps

Swap Modes

swap2 accepts SwapMode: New integrations should prefer swap2 and SDK getQuote2 because they share exact-in, partial-fill, and exact-out semantics.

Fees And Rewards

Reward index 0 and 1 are the only supported reward slots.