Skip to main content

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.

What it is

Stable AMM is a specialized variant of the Raydium AMM designed for pairs with known, well-behaved price relationships — primarily stablecoin–stablecoin pairs (USDC-USDT, USDH-USDC) and collateralized-token pairs. Instead of a constant-product curve, it uses a lookup table of (x, y, price) tuples that the pool admin populates via InitModelData and UpdateModelData instructions. Price discovery happens through interpolation within the table, producing lower slippage for small swaps while remaining composable with OpenBook. Stable AMM shares the same pool/OpenBook architecture as AMM v4: same MonitorStep logic, same Fees structure, same fee model. The difference is purely the pricing curve: instead of x·y=k, you interpolate a pre-populated model. Program ID: see reference/program-addresses. Token-2022: not supported. Classic SPL tokens only. Liquidity: thin. Most user-facing integrations reach Stable pools through the AMM Routing program for best-price routing across all Raydium AMMs. The SDK also supports Stable pools directly: pools surface as version: 5 (pooltype: "StablePool") on ApiV3PoolInfoStandardItem, and the standard LiquidityModule (addLiquidity / removeLiquidity / swap) auto-detects v5 and emits the right instructions — see Code demos.

Chapter contents

Overview

Why a separate program, the lookup-table model, comparison to AMM v4 and CPMM.

Accounts

AmmInfo, ModelDataInfo, DataElement fields, vault layout, fee structure.

Math

How interpolation produces prices, OpenBook integration, fee application identical to AMM v4.

Instructions

Initialize, InitModelData, UpdateModelData, Deposit, Withdraw, SwapBaseIn, SwapBaseOut, MonitorStep, and more.

Fees

Same 0.25% / 0.22% LP / 0.03% protocol split as AMM v4. No fund fee, no creator fee.

Code demos

Detect a Stable pool, swap / add / remove liquidity through the SDK’s LiquidityModule (handles v5 natively), and use the off-chain stable-curve helpers.

When to read this

  • You are integrating a stablecoin or asset pair and find a Stable AMM pool with the best price.
  • You are building a routing engine and need to support Stable pools as a liquidity source.
  • You are maintaining liquidity in a Stable pool — learning the model-data update flow.
  • You are curious how AMM pricing can be made programmable via a lookup table.

Key facts

AspectValue
Mainnet program ID5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h
Devnet program IDDRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m
Curve modelInterpolated lookup table (not x·y=k)
OpenBook dependencyYes, same as AMM v4
Trade fee0.25% (same as AMM v4)
LP share of fee0.22%
Protocol share of fee0.03%
Creator feeNone
Fund feeNone