As of the 2026-07 upgrade, AMM v4’s OpenBook / Serum dependency has been removed — no instruction reads or writes OpenBook state anymore. The market accounts below are retained only as positional placeholders on the legacy v1 instruction layouts (accepted but ignored) and as reference fields on
AmmInfo. Use the V2 swap entrypoints, which omit them entirely. This page still groups the accounts into “pool-owned” and “OpenBook (legacy)” sections for reading older transactions.Inventory
An AMM v4 pool records one bound market onAmmInfo at creation. The full picture:
Note: “serum” is kept as the prefix in AMM v4’s IDL and field names for backward compatibility. These accounts are no longer functional after the OpenBook removal.
AmmInfo
The pool’s root state account. Large (≈ 752 bytes) because it carries both pool and OpenBook references inline.
The struct layout is unchanged (byte-compatible) so existing deserializers keep working, but after the OpenBook removal the fields marked
DEPRECATED above are no longer written — the swap_* volume counters are frozen at their last value. For volume analytics, use trade logs rather than these fields. Only need_take_pnl_* and pool_open_time are actively maintained.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— legacy reference fields. Still present onAmmInfoand still passed positionally on the v1 instruction layouts, but the program no longer reads or validates them. The V2 swap entrypoints omit them.fees.swap_fee_numerator / swap_fee_denominator— the combined trade fee. Default25 / 10_000 = 0.25%.status— a single enumeratedu64state gating operations, not a bitmask. Admin-settable viaSetParamswithparam = 0(Status). See Status below.lp_amount— the pool’s internal LP total. It is not equal tolp_mint.supply: it is exactly one whole LP token (10^coin_decimalsbase units) higher, because that amount is counted at init but never minted. All pro-rata math useslp_amount, so use it too.amm_owner— written at creation from the program’s hardcoded admin key, not from the creator.state_data.need_take_pnl_*— delta between gross accrued fees and what’s been swept.TakePnlzeroes these.
The OpenBook wiring
Removed. The OpenBook / Serum dependency has been deleted from the program (2026-07 upgrade). The accounts described in this section are no longer validated or used. They remain as reference fields on
AmmInfo and as positional placeholders on the legacy v1 instruction layouts. Use the V2 swap entrypoints (SwapBaseInV2 / SwapBaseOutV2) which skip these accounts entirely.SwapBaseIn / SwapBaseOut, Deposit, or Withdraw instruction, the account count must still match the old layout (the market accounts occupy their historical positions), but their contents are no longer checked — no CPI is issued against them. New code should use the V2 swap variants, which do not take these accounts at all.
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.
254 on mainnet and is mirrored on every AmmInfo as nonce; WithdrawExcessLamports re-derives it with that nonce hardcoded.
Vaults
The pool’s SPL Token vaults are standard token accounts whoseowner is amm_authority. Not ATAs — their addresses are PDAs derived at Initialize2 from [AMM_V4_PROGRAM_ID, market, "coin_vault_associated_seed"] and [AMM_V4_PROGRAM_ID, market, "pc_vault_associated_seed"]. The mint is not a seed, and neither is amm_id. 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 Initialize2 with InvalidSplTokenProgram.
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.
There is an in-state mirror: AmmInfo.lp_amount. It is not equal to the mint’s supply — it sits exactly one whole LP token (10^coin_decimals base units) higher, because that amount is counted at init but never minted. Every pro-rata computation in the program divides by lp_amount, so use that field rather than the mint’s on-chain supply.
Status
AmmInfo.status is a single enumerated u64 state, not a bitmask. Test it for equality — a client testing status & 1 mis-classifies every live pool, because the normal trading state is 6, which has bit 0 set.
Initialize2 writes 7 when open_time is in the future and 6 otherwise; a pool at 7 flips itself to 6 on the first swap at or after state_data.pool_open_time. A value outside 0..=7 makes AmmStatus::from_u64 panic.
The Raydium multisig sets the state via SetParams with param = 0 (Status); only values 1–7 are accepted. (AdminCancelOrders has been removed.)
Observation / oracle
AMM v4 has no dedicated observation account, and since the OpenBook removal there is no order-book state to derive one from either. If you need a Raydium TWAP with program support, use CPMM or CLMM — both maintain anObservationState ring buffer. Otherwise, index the swap logs off-chain.
Deriving a pool’s accounts from scratch
AMM v4’s pool accounts are plain PDAs keyed on the bound market — not seeded keypairs, and not per-pair PDAs. Every one of them uses the same three-seed shape[AMM_V4_PROGRAM_ID, market, <label>] under AMM_V4_PROGRAM_ID:
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
Pools and their accounts persist indefinitely. Even if liquidity is fully withdrawn,
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 source (
github.com/openbook-dex/program) — a Rust monorepo, not prose documentation.
- Raydium AMM program —
raydium-io/raydium-amm reference/program-addressesfor canonical program IDs- OpenBook / Serum protocol for the counterparty accounts

