Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

DAMM v2 compounding liquidity is a pool mode where a share of LP fees is automatically reinvested back into the pool. Instead of every LP fee waiting to be claimed and manually compounded back, the pool can use part of those fees to grow reserves and deepen liquidity over time. This is useful for long-term pools where LPs want liquidity growth, fewer manual fee actions, and a simpler full-range market design.

How It Works

Compounding liquidity uses Compounding collect fee mode. In this mode:
  • The pool behaves like a full-range constant-product AMM.
  • Fees are collected in token B.
  • A configurable share of the LP fee is added back into the pool’s token B reserves.
  • The remaining LP fee stays claimable by position owners.
LP Fee=Compounding Fee+Claimable Fee\text{LP Fee} = \text{Compounding Fee} + \text{Claimable Fee} The compounding share is controlled by compounding_fee_bps, in basis points.
compounding_fee_bpsProduct Meaning
250025% of LP fees compound, 75% remain claimable
500050% of LP fees compound, 50% remain claimable
10000100% of LP fees compound, no LP fee remains claimable
compounding_fee_bps must be greater than 0 and at most 10000 for compounding pools. It must be 0 for BothToken and OnlyB pools.

Full-Range by Design

Compounding pools do not use custom concentrated price ranges. The program stores their range as 0 to u128::MAX and prices them from reserves: token A reserves×token B reserves=k\text{token A reserves} \times \text{token B reserves} = k This makes the pool easier to reason about: reserves grow as compounded fees are added back, and LPs benefit proportionally through their position liquidity.

Initial Liquidity

Compounding pools have one special initialization rule: the requested initial liquidity must be greater than DEAD_LIQUIDITY, which is 100 << 64. DAMM v2 subtracts this dead liquidity from the first position’s liquidity while keeping it in the pool’s total liquidity.
The dead-liquidity rule prevents the pool from starting at a fragile zero-liquidity edge. It also means the first position receives slightly less liquidity than the raw initialization liquidity.
The initial token amounts are derived from the requested liquidity and initial square-root price: token A=LP\text{token A} = \left\lceil \frac{L}{\sqrt{P}} \right\rceil token B=L×P2128\text{token B} = \left\lceil \frac{L \times \sqrt{P}}{2^{128}} \right\rceil The initial square-root price still must be inside DAMM v2’s global price limits, even though the compounding pool itself has no custom range.

What LPs Experience

In a non-compounding pool, LP fees accumulate as claimable balances on the position. In a compounding pool, the LP fee is split after the protocol fee is removed:
  • Compounded portion: added to pool reserves, increasing pool depth.
  • Claimable portion: remains pending on the LP position and can be claimed later.
This lets a pool balance two goals: grow liquidity over time and still provide claimable fee income.

Why Token B Matters

In compounding mode, fees are always handled in token B. For an A-to-B swap, the fee is taken from token B output. For a B-to-A swap, the fee is taken from token B input. Token B is commonly the quote token, such as SOL or USDC.

Product Benefits

Automatic Reserve Growth

A share of LP fees goes directly back into the pool, increasing liquidity without a separate reinvest action.

Simpler Full-Range Liquidity

The pool follows the familiar constant-product model instead of a custom price range.

Flexible Fee Split

Pool creators can choose how much LP fee compounds and how much remains claimable.

Long-Term LP Alignment

LPs benefit from deeper pool reserves while still owning their position through an NFT.

Best Use Cases

Established markets can use compounding liquidity to grow depth as trading activity generates fees.
LPs who prefer fewer manual actions can let part of their fee income automatically support the pool.
Projects can use compounding to reinforce long-term liquidity depth while keeping fee behavior transparent on-chain.

When Not to Use It

Use concentrated liquidity instead if the pool needs a custom minimum and maximum price range. Compounding liquidity is intentionally full-range, so it is not the right fit for a tightly targeted launch range.