in-solana by Supanode

Raydium CPMM — Program ID & Overview

CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C

Raydium CPMM (Constant Product Market Maker) is a simplified AMM that replaces AMM V4 for standard liquidity pools. Unlike V4, CPMM does not require a linked OpenBook market and natively supports Token-2022 tokens.

Program ID

CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C

CPMM vs AMM V4

FeatureAMM V4CPMM
OpenBook market requiredYesNo
Token-2022 supportNoYes
Pool creation costHigher (market + pool)Lower (pool only)
Formulax*y=kx*y=k
Swap fee0.25% fixedConfigurable per pool

Key instructions

InstructionDescription
InitializeCreates a new CPMM pool
DepositAdds liquidity, receives LP tokens
WithdrawRemoves liquidity, burns LP tokens
SwapBaseInputSwap a fixed input amount
SwapBaseOutputSwap for a fixed output amount

Pool creation

CPMM pools can be created without a linked orderbook market, reducing setup cost and complexity.

// CPMM pool creation requires:
// 1. Token A mint
// 2. Token B mint  
// 3. Initial liquidity amounts for both tokens
// 4. Fee configuration

// The pool PDA is derived from the two token mints
// Mints are sorted deterministically (lower address first)

Token-2022 support

CPMM is the first Raydium pool type to support Token-2022 (SPL Token 2022) tokens. This includes tokens with:

  • Transfer fees
  • Interest-bearing mints
  • Non-transferable tokens (excluded from trading)
  • Confidential transfers

When a Token-2022 token has a transfer fee, the pool accounts for the fee in swap calculations automatically.

FAQ

Should I use CPMM or AMM V4 for a new token? CPMM is recommended for new pools. It is simpler, cheaper to create, and supports Token-2022. AMM V4 is primarily used for legacy pools and tokens that specifically need orderbook integration.

What fees does CPMM charge? Fees are set at pool creation and vary. The protocol takes a portion of trading fees; the remainder goes to liquidity providers.

Can CPMM pools be migrated from AMM V4? No direct migration exists. You would need to withdraw liquidity from the V4 pool and deposit it into a new CPMM pool.

Updated: