# How fees work

Every swap on Raydium incurs a trading fee. The fee tier is set when the pool is created and determines how much a trader pays on each swap.

### CLMM fee tiers and tick spacing

In CLMM pools, the fee tier and tick spacing are paired together in an `AmmConfig` account. Each config defines both values — you can't set them independently. The pairing exists because tick spacing controls how granular LP price ranges can be, and that granularity needs to match the fee tier to work economically.

| Fee tier        | Tick spacing | Typical use              |
| --------------- | ------------ | ------------------------ |
| 1 bps (0.01%)   | 1            | Stable pairs (USDC-USDT) |
| 5 bps (0.05%)   | 10           | Major pairs (SOL-USDC)   |
| 30 bps (0.30%)  | 60           | Volatile pairs           |
| 100 bps (1.00%) | 120          | High volatility          |

Lower tick spacing means LPs can set tighter price ranges — important for stable pairs where prices move in tiny increments. But smaller tick spacing also means more tick arrays to initialize and more ticks to traverse per swap. Higher tick spacing is coarser but cheaper to operate in, which suits volatile pairs where tight ranges would go out of range quickly anyway.

The fee tier compensates LPs for the risk profile of the pair. Stable pairs barely move, so LPs face minimal impermanent loss and a low fee is enough. Volatile pairs rebalance aggressively, so LPs need higher fees to offset the IL.

Only one pool can exist per token pair per `AmmConfig`. If a SOL-USDC pool already exists at 5 bps / tick spacing 10, you can't create another one with the same config — but you can create one at a different fee tier.

### CPMM fees

CPMM pools also reference an `AmmConfig`, but since there's no tick spacing involved, the config only defines fee rates. The `trade_fee_rate` is denominated in hundredths of a basis point (10⁻⁶), so a value of `2500` means 0.25%.

The pool creator selects from available configs at creation time, and Raydium can create new configs with different fee rates. The fee rate is fixed for the lifetime of the pool.

### How fees accrue

The two pool types handle earned fees differently.

In CPMM pools, fees are folded directly into the pool reserves. This increases the value of LP tokens over time — your share of the pool grows automatically without any action.

In CLMM pools, fees accumulate inside your position but are **not** auto-compounded. They sit uncollected until you call `decrease_liquidity` (even with a zero amount) to transfer them to your wallet. Only liquidity that is in-range at the time of a swap earns a share of the fee.

### Fee split

Across both pool types, trading fees are split the same way:

* **84%** to liquidity providers
* **12%** to RAY buybacks
* **4%** to treasury

For protocol-level fee details, see [Protocol fees](https://app.gitbook.com/s/KX8cS73yXvgQvrUBJnkm/protocol-fees).
