Stable AMM is its own program; its pool-side account structure resembles AMM v4 (AmmInfo, vaults, authority), and it additionally has a
ModelDataInfo account that stores the lookup table. This page covers both.Inventory
Pure AMM. Stable AMM holds all liquidity in its own vaults and does not depend on OpenBook. It carried an OpenBook market-making path early in its life, but that path has been dormant for years, and the 2026-06-22 upgrade removed the leftover code. The
serum_* market accounts and amm_open_orders below are therefore legacy: they may still appear in old-layout transactions for backwards compatibility, but the program does not validate or read them, and new-layout instructions omit them entirely.| Category | Account | Owner | Role |
|---|---|---|---|
| Pool | AmmInfo | Stable program | Pool state, references to vaults and the model-data account. |
| Pool | amm_authority | Stable program | Program-owned PDA that signs vault moves. Shared across all Stable AMM pools. |
| Pool | amm_target_orders | Stable program | Pool-side grid account (retained in layouts; no longer drives OpenBook orders). |
| Pool | pool_coin_token_account | SPL Token | Pool’s coin-side vault. |
| Pool | pool_pc_token_account | SPL Token | Pool’s pc-side vault. |
| Pool | lp_mint | SPL Token | Fungible LP mint. |
| Model | model_data_account | Stable program | The lookup table: 50,000 × DataElement. |
| Legacy | amm_open_orders | OpenBook | The pool’s old OpenBook OpenOrders account. Unused. |
| Legacy | serum_market | OpenBook | OpenBook market. Unused. |
| Legacy | serum_bids, serum_asks | OpenBook | Bid/ask queues. Unused. |
| Legacy | serum_event_queue | OpenBook | Event queue. Unused. |
| Legacy | serum_coin_vault, serum_pc_vault | SPL Token | OpenBook market-level vaults. Unused. |
| Legacy | serum_vault_signer | OpenBook | Market-level vault signer. Unused. |
AmmInfo
Root state account. Layout is nearly identical to AMM v4 — pool params, decimals, fees, vault/mint references — with one addition: a model_data_key field pointing to the lookup table.
model_data_key— the address of the lookup table. Must be passed to every instruction.fees— identical structure to AMM v4. Defaults to 0.25% trade fee, 0.22% LP / 0.03% protocol split.coin_vault,pc_vault— the pools’ vaults.status— bitmask gating swap/deposit/withdraw/crank.out_put.need_take_pnl_*— swept byWithdrawPnl.
ModelDataInfo
The lookup table. A large sparse array of price/quantity points.
InitModelData (created the account) and UpdateModelData (populated elements, setting valid_data_count) — were removed in the 2026-06-22 upgrade. The tables on existing pools are now fixed. At runtime, the remaining callable instructions still consume them:
- Swap / deposit / withdraw call lookup functions that binary-search and interpolate within
elements[0..valid_data_count].
DataElement
The atomic entry in the table. Must be sorted (x ascending, y descending, price ascending) for binary search to work.
Authority and vaults
Same as AMM v4:amm_authorityis a single program-wide PDA derived with seed["amm authority"]. It owns all pool vaults and signs their moves.- Vaults are SPL Token accounts whose owner is
amm_authority, not ATAs.
Status bitmask
Identical to AMM v4. Controls whether swap/deposit/withdraw/crank are enabled.Fee and PnL tracking
Theout_put struct tracks:
need_take_pnl_coin,need_take_pnl_pc— protocol fees accrued but not yet swept.WithdrawPnlmoves these out.swap_coin_in_amount,swap_pc_in_amount, etc. — analytics counters.
Account size
TheModelDataInfo is large (~1.2 MB, since 50,000 elements × 24 bytes per element). This is why creating a Stable pool requires explicit rent and account pre-allocation. The Raydium SDK and tools handle this transparently; integrators rarely need to manually allocate.
Deriving accounts from scratch
Like AMM v4, Stable AMM uses seeded keys (not pure PDAs). The canonical pool identity is derived via:What to read where
- Instruction account lists:
products/stable/instructions. - How interpolation uses the table:
products/stable/math. - Fee structure and WithdrawPnl:
products/stable/fees. - The 2026-06-22 OpenBook decoupling:
reference/changelog.

