DAMM v1 is a full-range AMM with two main curve designs: constant-product pools for volatile assets, and stable-swap pools for assets that should trade close together. The formulas below explain how the product behaves without turning this page into an integration guide.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.
Constant-product pools
The basic volatile-pool formula is: Where:xis the amount of token A in the pool.yis the amount of token B in the pool.kis the pool invariant.
x rises and y falls. The pool reprices the trade so the relationship between both reserves stays balanced.
For users, this means:
- Larger pools usually create lower price impact.
- Larger trades move price more than smaller trades.
- The pool supports a continuous price range from very low to very high prices.
Constant-product swap output
Before fees, a simplified output calculation looks like this: DAMM v1 uses safe on-chain integer math, so tiny rounding differences can happen at the smallest token unit. Product-wise, the idea is straightforward: every buy makes the bought token scarcer in the pool, which raises its price for the next trade.Stable pools
Stable pools are designed for assets that should trade near a target relationship, such as USDC/USDT or SOL/LST markets. Instead of using onlyx × y = k, DAMM v1 stable pools use a StableSwap-style invariant with an amplification factor.
A simplified StableSwap invariant can be represented as:
Where:
Ais the amplification factor.nis the number of assets in the pool. DAMM v1 pools are two-token pools.x_irepresents normalized token balances.Dis the stable pool invariant.
A higher amplification factor concentrates more liquidity near the target relationship, but it also makes the pool less forgiving when the assets move far away from that relationship.
Token normalization
Stable pools normalize token amounts before applying the curve. This matters when two tokens have different decimals. The goal is to compare both assets on a consistent precision scale before calculating swaps, deposits, and withdrawals.LST depeg adjustment
For supported LST pools, DAMM v1 can account for the changing value of the staking token relative to SOL. The program stores and updates a base virtual price for the LST side of the pool. Conceptually: This lets the pool reason about an LST’s value instead of treating one LST as always equal to one SOL. That is important because LSTs generally increase in SOL terms as staking rewards accrue.LP share ownership
LP tokens represent a share of the pool. A simplified LP ownership formula is: The value of that share depends on the pool’s underlying token value: DAMM v1 pools route token balances through Dynamic Vaults. That means the pool often measures its token A and token B totals by converting vault LP balances back into underlying token amounts.Virtual price
Virtual price is a useful way to understand whether a pool share is becoming more valuable over time.D is the curve invariant computed from the pool’s vault-backed token amounts. For constant-product pools, DAMM v1 uses sqrt(x * y). For stable pools, it uses the StableSwap invariant.
Virtual price can rise when:
- Swaps generate fees that remain in the pool.
- Eligible vault assets earn yield.
- Rewards or yield increase the underlying value backing pool shares.
Trading fees
DAMM v1 charges trading fees on swaps. A simplified fee calculation is: DAMM v1 also supports protocol fees: The protocol fee is computed from the total trading fee. The remaining fee value benefits LPs because it stays with the pool and increases the value backing LP tokens.DAMM v1’s fee math has a minimum-fee behavior for non-zero trades when the calculated fee would otherwise round down to zero. This prevents tiny trades from bypassing fees entirely.
Base APY from virtual price
DAMM v1 APY can be estimated from virtual price growth over a time window: Where:Virtual Price 1is the earlier virtual price.Virtual Price 2is the later virtual price.timeframeis the time between the two measurements.
365-day fee over TVL
A simple fee efficiency metric annualizes recent swap fees against pool liquidity: This helps LPs compare how much fee activity a pool is generating relative to the amount of liquidity supplied.External farm rewards
External DAMM v1 farms distribute reward tokens to staked LP tokens over time. Farming is a separate reward layer around the AMM LP token, not core swap logic inside the AMM program. A simplified reward rate is: Reward per staked LP token grows as time passes: A user’s pending reward is based on their staked balance: DAMM v1 farm integrations have historically supported up to two reward tokens. Check the farm program and campaign configuration for exact reward-accounting behavior.LM APR
Liquidity mining APR estimates the annualized value of farm emissions relative to farm TVL: Where:farm reward per dayis the daily token emission value in USD.farm TVLis the value of LP tokens staked in the farm.pool TVLis the value of all token A and token B liquidity in the pool.

