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.
Router fee
The AMM Routing program charges no fee of its own. It is a pure orchestrator. All fees are paid directly to the pools you route through:- Each AMM v4 hop pays the AMM v4 fee (0.25% split).
- Each CPMM hop pays the CPMM fee (configurable, typically 0.25% split).
- Each CLMM hop pays the CLMM fee (configurable per pool).
- Each stable hop pays the stable-swap fee (like AMM v4, typically 0.25% split).
Total effective fees on a route
If you route through N pools, your total fee is the sum of all N hops’ fees, compounded. Example: Route: USDC → SOL (0.25% fee) → STEP (0.25% fee)products/amm-v4/feesproducts/cpmm/feesproducts/clmm/fees(if available)products/stable/fees(if available)
Compute cost
The router’s compute cost is linear in the number of hops:- Fixed overhead: ~5k CU for the router’s dispatch logic and account validation.
- Per-hop cost: ~10k–50k CU depending on the pool type and complexity:
- CPMM: ~20k–30k CU
- AMM v4: ~40k–60k CU (includes OpenBook validation)
- CLMM: ~50k–100k CU (tick-math heavy)
- Stable: ~30k–40k CU
- Total transaction budget: 1.4M CU on mainnet. A route with 10 CPMM hops would cost ~305k CU, leaving room for other operations.
Account initialization overhead
Every enabled swap variant routes intermediate tokens through user-controlled ATAs. On each intermediate hop, you must pre-create and provide a user-owned ATA:- If the ATA doesn’t exist: ATA program init costs ~5k CU + ~0.00203928 SOL rent per ATA. Initialize it with the SPL Associated Token Account program (or, for wSOL, with
CreateSyncNativetag 5). - If the ATA already exists: no extra overhead.
CloseTokenAccount (tag 6) once it has zero balance.
Where to go next
products/routing/instructions— which instruction to use for your route shape.products/routing/code-demos— examples of quoting routes before execution.integration-guides/routing-and-mev— broader fee and MEV strategy.


