One-paragraph summary
Stable AMM is a standalone Raydium program — its own deployment, not a mode of AMM v4 — that trades a curve formula for a pre-populated lookup table. Instead of using x·y=k, the pool stores a sparse array of (x, y, price) points and uses binary search + linear interpolation to quote prices. This design excels at stablecoin pairs and other assets with known price relationships: swaps between 1-to-1 pegged tokens have near-zero slippage. It is a pure AMM: all liquidity sits in the pool’s own vaults. (It carried an OpenBook market-making path early in its life, but that path has been dormant for years; the 2026-06-22 upgrade finally removed the dead market code.) Liquidity is currently thin; most integrators reach Stable pools through the AMM Routing program.Why a lookup table instead of xy=k
Constant-product AMMs incur high slippage on pairs with tight price bands. A USDC-USDT swap should cost almost nothing; on a constant-product pool, k=x·y forces a price move even for tiny volume. A lookup table lets the pool admin express the actual price relationship:- For stablecoins: density the table around 1:1 so micro-swaps cost ~0 slippage.
- For collateralized pairs: encode the target ratio and let the grid shape the fee/incentive surface.
UpdateModelData instruction, which has since been removed, so existing pools keep their tables as-is. The on-chain cost is just interpolation search — much cheaper than recomputing a formula.
How it works: the model-data account
The pool holds aModelDataInfo account — a 50,000-element array of DataElement structs. Each element holds:
valid_data_count elements are populated; the rest are zeroed. On swap, the program:
- Computes a ratio from the current pool reserves and uses binary search to find which two table elements bracket that ratio.
- Interpolates linearly between the two bracketing points to get the quote price.
- Applies fees (same 0.25% as AMM v4) and returns the result to the user.
multiplier field on the table accounts for the possibility that x and y are stored at a reduced scale (e.g., with 6 decimals instead of 18). Price discovery rescales accordingly.
Comparison: Stable AMM vs. AMM v4 vs. CPMM
| Dimension | Stable AMM | AMM v4 | CPMM |
|---|---|---|---|
| Curve | Lookup table + interpolation | Constant product (xy=k) | Constant product |
| Primary use case | Stablecoins, pegged pairs | General pairs, legacy deep liquidity | General pairs, new deployments |
| OpenBook dependency | No (market path long dormant; dead code removed 2026-06) | Yes | No |
| Token-2022 | No | No | Yes |
| Slippage profile | Minimal at 1:1 | High at tight ratios | Moderate across range |
| Admin-tunable curve | No longer (UpdateModelData removed; tables now fixed) | No (SetParams only) | No |
| Table size | ~50k elements × 24 bytes | N/A | N/A |
| Compute per swap | ~5k–15k CU (binary search + interpolation) | ~150k–200k CU | ~60k–100k CU |
| Account count per swap | 9 (new layout; 18 old-compat) | ~18 (AMM + OpenBook) | ~11 |
Mental model
A Stable AMM pool is an interpolated lookup-table AMM that holds all of its liquidity in its own vaults. The key difference from a constant-product pool is that the price-discovery curve is not hardcoded — it is a sparse array baked into the pool’sModelDataInfo account. The currently callable operations are direct swap (user ↔ pool), deposit / withdraw (LP ops), and WithdrawPnl (admin fee sweep). The OpenBook crank (MonitorStep) — long dormant since the pool stopped posting orders — and the pool-setup/admin instructions have been removed.
When Stable AMM is the right choice
- You operate a stablecoin or other correlated-asset pair and want tight, predictable pricing.
- You have deep knowledge of your pair’s price relationship and want to encode it directly as a curve.
- You already have integrations for AMM v4 and simply need a different curve flavor.
Where to go next
- Accounts —
AmmInfo,ModelDataInfo,DataElementfield reference. - Math — binary search, interpolation, and fee application.
- Instructions — the callable set (swap, deposit, withdraw,
WithdrawPnl) and the removed instructions. - Fees — the 0.25% split (identical to AMM v4).
- Code demos — routing and direct integration.
reference/program-addressesfor the canonical program IDreference/changelogfor the 2026-06-22 market-code-removal upgrade

