> ## 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.

# Routing fees

> The router takes no fee. Each hop pays its pool's fee. Compute cost scales linearly with route depth.

## 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)

```
Input: 1000 USDC

Hop 1 (USDC/SOL): 0.25% fee
  Fee: 2.5 USDC
  Output to hop 2: ~997.5 USDC of buying power

Hop 2 (SOL/STEP): 0.25% fee
  Fee: ~2.49 STEP-worth
  Output: ~995 STEP-worth

Total cost: ~0.5% (not exactly 0.5%, since fees compound)
```

See the respective pool's fee documentation for exact splits:

* [`products/amm-v4/fees`](/products/amm-v4/fees)
* [`products/cpmm/fees`](/products/cpmm/fees)
* [`products/clmm/fees`](/products/clmm/fees) (if available)
* [`products/stable/fees`](/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.

See the individual pool's documentation for exact CU costs.

## 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 [`CreateSyncNative`](/products/routing/instructions#createsyncnative-tag-5) tag 5).
* **If the ATA already exists:** no extra overhead.

For a 5-hop route with 4 intermediate tokens, you would need 4 new ATAs if starting fresh = \~20k CU + \~0.00816 SOL.

You can recover the rent of any temporary ATA — most commonly a wSOL ATA used for a single route — by closing it with [`CloseTokenAccount`](/products/routing/instructions#closetokenaccount-tag-6) (tag 6) once it has zero balance.

## Where to go next

* [`products/routing/instructions`](/products/routing/instructions) — which instruction to use for your route shape.
* [`products/routing/code-demos`](/products/routing/code-demos) — examples of quoting routes before execution.
* [`integration-guides/routing-and-mev`](/integration-guides/routing-and-mev) — broader fee and MEV strategy.
