Documentation Index
Fetch the complete documentation index at: https://docs.raydium.io/llms.txt
Use this file to discover all available pages before exploring further.
AMM v4 is significantly more account-heavy than CPMM or CLMM because every operation touches OpenBook state. This page groups the accounts into “pool-owned” and “OpenBook-owned” sections so an integrator can quickly see which side is which.
Inventory
An AMM v4 pool binds to exactly one OpenBook market at creation. The full live picture is:| Category | Account | Owner | Role |
|---|---|---|---|
| Pool | AmmInfo | AMM v4 program | Pool state: fees accrued, status, references to vaults and OpenBook market. |
| Pool | amm_authority | AMM v4 program | Program-owned PDA that signs vault moves. Shared across all AMM v4 pools. |
| Pool | amm_open_orders | OpenBook | The pool’s OpenBook OpenOrders account for this market. |
| Pool | amm_target_orders | AMM v4 program | Pool-side grid of target limit orders to post back onto OpenBook. |
| Pool | pool_coin_token_account | SPL Token | Pool’s coin-side vault (ATA of amm_authority). |
| Pool | pool_pc_token_account | SPL Token | Pool’s pc-side vault. |
| Pool | lp_mint | SPL Token | Fungible LP mint. |
| Pool | pool_withdraw_queue | AMM v4 program | Legacy queue for delayed withdrawals; kept zero-length. |
| Pool | pool_temp_lp | AMM v4 program | Auxiliary LP account used during Initialize. |
| Market (OpenBook) | serum_market | OpenBook | The market itself (base/quote mints, vault signer, etc.). |
| Market | serum_bids, serum_asks | OpenBook | The bid and ask queues. |
| Market | serum_event_queue | OpenBook | Pending events (fills, cancellations). |
| Market | serum_coin_vault, serum_pc_vault | SPL Token | OpenBook’s market-level vaults. |
| Market | serum_vault_signer | OpenBook | Market-level PDA that signs serum_*_vault moves. |
AmmInfo
The pool’s root state account. Large (≈ 752 bytes) because it carries both pool and OpenBook references inline.
coin_vault,pc_vault— the pool’s SPL Token vaults.coinistoken_0by Serum/OpenBook convention (base),pcistoken_1(quote).coin_decimals,pc_decimals— matching the mints.open_orders,target_orders,market— must be passed to every swap/deposit/withdraw instruction.fees.swap_fee_numerator / swap_fee_denominator— the combined trade fee. Default25 / 10_000 = 0.25%.status— bitmask gating operations. Admin-settable viaAdminSetStatus.state_data.need_take_pnl_*— delta between gross accrued fees and what’s been swept.TakePnlzeroes these.
The OpenBook wiring
No longer active. AMM v4 pools no longer share liquidity to OpenBook — the limit-order grid has been deactivated. The OpenBook accounts described in this section remain on each pool’s
AmmInfo and are still validated by V1 swap entrypoints (and by Initialize, Deposit, Withdraw) for backwards compatibility, but the on-book state they reference is empty in practice. Use the V2 swap entrypoints (SwapBaseInV2 / SwapBaseOutV2) which skip these accounts entirely and represent the canonical execution path today.amm_open_orders is an OpenBook-owned account holding the pool’s limit-order state on this market: active orders, settled balances, referrers, etc. amm_target_orders is AMM-side: it holds the AMM’s intended grid (price/size for each order slot) so the program can cheaply compare against what’s currently posted and place / cancel the diff.
Authority PDAs
There is exactly oneamm_authority PDA for the entire AMM v4 program. Its seed is trivial (["amm authority"]) and its bump is stored on every AmmInfo. This authority signs all token moves for all AMM v4 pools.
amm_authority above actually covers both in this program’s design; different versions used different derivation, so check the specific pool’s AmmInfo.nonce in code).
Vaults
The pool’s SPL Token vaults are standard token accounts whoseowner is amm_authority. Not ATAs — their addresses are specific PDAs derived at Initialize with ["amm_associated_seed", coin_mint_or_pc_mint, market, amm_id] seeds. Addresses are stored on AmmInfo; derivation is a one-time curiosity.
Token-2022 is not supported. The program hardcodes SPL Token’s program ID for all vault moves. Attempting to bind an AMM v4 pool to a Token-2022 mint fails at Initialize.
LP mint
A classic SPL Token mint whose authority isamm_authority. Total supply tracks LP ownership of the pool; burning LP returns tokens from both vaults pro-rata. Because AMM v4 predates CPMM, there is no lp_supply mirror in the pool state — read the mint’s on-chain supply directly.
Status bitmask
AmmInfo.status gates operations. Bits (position may differ across program versions — confirm via the source):
| Bit | Flag | Effect |
|---|---|---|
| 0 | SWAP_DISABLED | Swap* rejects. |
| 1 | DEPOSIT_DISABLED | Deposit rejects. |
| 2 | WITHDRAW_DISABLED | Withdraw rejects. |
| 3 | CLMM_LIKE_MIGRATE | Migration-gate flag used by ops. |
AdminCancelOrders, AdminSetParams, etc.
Observation / oracle
AMM v4 has no dedicated observation account. Other protocols that need an on-chain TWAP typically consume OpenBook’s book crossings indirectly or read off-chain. If you need a Raydium TWAP with program support, use CPMM or CLMM.Deriving a pool’s accounts from scratch
Because AMM v4 was not designed for deterministic per-pair PDAs (it pre-dates that Solana convention), the canonicalamm_id is a seeded keypair derived with:
amm_open_orders, amm_target_orders, amm_withdraw_queue, pool_temp_lp, pool_coin_token_account, pool_pc_token_account, and lp_mint. The SDK and API pre-compute these for you; see raydium-sdk-v2’s Liquidity.getAssociatedPoolKeys.
In practice, integrators read the pool’s full account set from GET https://api-v3.raydium.io/pools/info/ids?ids=<POOL_ID> or from the SDK. Hand-deriving is rarely needed.
Lifecycle quick reference
| Event | Accounts created | Accounts destroyed |
|---|---|---|
Initialize2 | amm_info, amm_open_orders, amm_target_orders, vaults, lp_mint, pool_withdraw_queue, pool_temp_lp | — |
Deposit | — (may create user LP ATA) | — |
Withdraw | — | — |
SwapBaseIn / SwapBaseOut | — (may create user ATA) | — |
TakePnl | — | — |
MonitorStep (crank) | — | — |
AmmInfo stays.
What to read where
- Math and fee arithmetic:
products/amm-v4/math. - Fee split and how it compares to CPMM/CLMM:
products/amm-v4/fees. - Instruction account lists:
products/amm-v4/instructions. - OpenBook account derivation: OpenBook program docs (
github.com/openbook-dex/program).
- Raydium AMM program —
raydium-io/raydium-amm reference/program-addressesfor canonical program IDs- OpenBook / Serum protocol for the counterparty accounts


