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 fees are configurable, but they are not arbitrary. The cp-amm program combines one base fee mode, an optional dynamic fee layer, a protocol fee split, an optional referral split, and a collect fee mode that determines which token pays the fee.

Fee Layers

DAMM v2 first calculates the total fee numerator: Total Fee Numerator=min(Base Fee Numerator+Dynamic Fee Numerator,Pool Fee Cap)\text{Total Fee Numerator} = \min(\text{Base Fee Numerator} + \text{Dynamic Fee Numerator}, \text{Pool Fee Cap}) The denominator is 1,000,000,000. A fee of 1 bps is 100,000 in numerator units. After the trading fee is calculated, DAMM v2 splits it:
ComponentProgram Behavior
Protocol feeDefaults to 20% of the trading fee
Referral feeDefaults to 20% of the protocol fee when a referral is present
LP feeTrading fee after protocol fee
Compounding feeIn compounding mode only, a share of the LP fee added back to reserves
Claimable feeLP fee remaining after the compounding share

Base Fee Modes

DAMM v2 has five base fee modes, where Time Scheduler and Market Cap Scheduler each have linear and exponential curves.

Time Scheduler

Fee is fixed or decays over time using a linear or exponential curve.

Market Cap Scheduler

Fee decreases as the square-root price moves above the initial price, using a linear or exponential curve.

Rate Limiter

Fee increases with buy size during a bounded launch window.

Dynamic Fees

Dynamic Fees

Optional volatility-based fee layer on top of the selected base fee mode.

Collect Fee Modes

Collect fee mode determines which token pays LP and protocol fees.
ModeA-to-B swapB-to-A swapNotes
BothTokenFee taken from token B outputFee taken from token A outputFees can accrue in both tokens
OnlyBFee taken from token B outputFee taken from token B inputQuote-token fee collection
CompoundingFee taken from token B outputFee taken from token B inputToken B fees, with atomic LP fee compounding
Rate limiter mode is only valid with OnlyB collect fee mode. Compounding pools use Compounding collect fee mode and require a non-zero compounding_fee_bps.

Fee Caps and Updates

The current pool version supports total fee caps up to 99%. Older version 0 pools are capped at 50%. The minimum fee is 1 bps.

Choosing a Fee Design

Use a time scheduler. Linear decay changes by a fixed amount each period; exponential decay changes by a percentage-style factor each period.
Use a market-cap scheduler. Fees stay elevated until the square-root price advances through configured steps, or until the scheduler expires.
Use the rate limiter with OnlyB collect fee mode. It only applies to B-to-A buy-side swaps during the configured limiter window.
Add dynamic fees. They sit on top of the base fee and rise when recent price movement increases the volatility accumulator.