# The Liquidity Problem That DAMM v2 Solved > DAMM v2 Release 0.2.0 introduces a new pool collect fee mode: Compounding. **Published by:** [Buidling Onchain](https://blog.dannwee.xyz/) **Published on:** 2026-03-23 **Categories:** meteora, damm-v2, constant-product, amm, liquidity, solana **URL:** https://blog.dannwee.xyz/the-liquidity-problem-that-damm-v2-solved ## Content @latebuild wrote a piece a while back on how fee extraction is structurally murdering memecoin liquidity. The diagnosis is right. But the solution was never “another router” or a middleware patch. It's a program upgrade. Recently, Meteora deployed native fee compounding in DAMM v2. It's a new fee mode baked into the AMM program itself where the compounding happens inside the swap instruction, atomically, on every single trade.What We DeployedDAMM v2 Release 0.2.0 introduces a new pool collect fee mode: Compounding. When a pool creator sets this mode, a configurable percentage (between 0% to 100%) of quote token trading fees are compounded directly back into pool reserves on every swap. The rest remains claimable. Just ONE parameter, compoundingFeeBps, to control the split. Set it to 10000 bps (100%) and every bps of trading fees earned goes back into the pool. Set it to 5000 bps (50%) and you collect half, compound the other half. This new fee mode is baked into the core AMM, deployed onchain, audited, and open-source.Why Program-Level Compounding Changes EverythingEvery constant-product AMM operates on the same invariant: x · y = k where x is base token reserves, y is quote token reserves, and k is the constant that defines the pool's liquidity. So in other words, a larger k = deeper pool liquidity = less slippage. Previously, DAMM v2 fees are collected and claimed separately due to the quote token fee earnings feature. Many builders loved this as it didn't require the protocol or the liquidity provider to dump the memecoin into SOL or USDC when collecting fees. But this led to a limitation. The pool liquidity doesn't grow from trading activity, it only grows when someone manually adds liquidity. With CollectFeeMode.Compounding, k grows on every trade. When a swap executes, the program calculates the trading fee, splits it according to compoundingFeeBps, and adds the compounding portion directly back to the quote token reserves, all within the same instruction. No separate transaction. No external claim. The fee never leaves the pool.This means after every swap: x · (y + compoundingFee) = k' where k' > k The invariant increases. The pool is structurally deeper than it was before the trade. The next trade has slightly less price impact. The ceiling is slightly higher. Every trade that follows compounds on top of the previous one. This is the flywheel @latebuild described, but enforced at the program level where: more volume → more fees → higher k → less slippage → bigger buys possible → higher ceiling → more volumeThe key difference is that nothing can break this loop. There's no bot to go offline. No claim transaction to miss. No swap step that leaks value due to price impact. The compounding is atomic and unconditional.Why DAMM v2 Beats Every AlternativeMost AMMs decide where your fees go. DAMM v2 lets you. Raydium AMM v4 had a fixed 0.25% fee per trade. 0.22% went back to the pool and auto-compounded. 0.03% went to RAY buybacks. That's 88% fee compounded back, but hardcoded. Every pool got the same split regardless of what the token needed. No configuration. No creator fee. No dynamic adjustment. PumpSwap tried to improve on this with a tiered fee schedule based on SOL-denominated market cap. At the lowest tier (0–420 SOL mcap), where the vast majority of graduated tokens live, the split is 0.93% to the protocol, 0.30% to the creator, and 0.02% to the pool. Which leads to a 98.4% non-compounding rate on a 1.25% total fee. At the highest tier (98,240+ SOL), the LP fee rises to 0.20% on a 0.30% total fee. Better, but still lower than the 0.22% Raydium AMM v4 gave. And almost no token reaches that tier. The overwhelming majority of trading volume happens at the bottom of the schedule. No configuration. No creator control. DAMM v2 with CollectFeeMode.Compounding doesn't iterate on either model. It operates on a fundamentally different one. The pool creator sets compoundingFeeBps at creation (anywhere from 0 to 10,000 basis points) and that percentage of quote token fees compounds directly into pool reserves on every swap. Inside the swap instruction. Same transaction. The numbers make the gap obvious. On $100K volume, a DAMM v2 pool with 100% compounding and a 1% fee returns up to $1,000 to the pool, compared to $220 on Raydium and $20 on PumpSwap at the lowest tier. After $1M cumulative volume, the gap accelerates. Every dollar that flows into k generates future fees that also flow into k. The difference isn't linear. It compounds.The Full DAMM v2 StackFee compounding alone would be enough to justify the switch. But what makes DAMM v2 a generational upgrade is how compounding stacks with everything else the program already does.Dynamic fees + Compounding: Fees adjust based on real-time volatility. Volatile periods don't just earn more, they compound more into the pool, structurally deepening liquidity exactly when it needs to be deepest. Fee time / market cap scheduling + Compounding: Fees start high at launch and decay on your terms, either by time or by market cap. With 100% compounding, the highest-fee period of a token's life builds the deepest liquidity. Set launch fees at 5%, decaying to 0.5% over 24 hours or when a token reaches a certain market cap. The first hour of manic trading builds a liquidity base that other AMMs would take weeks otherwise. Position NFTs + Compounding: Positions are lockable and vestable while still accruing compounded fees. Lock liquidity, set compounding to 100%, and the pool deepens itself without anyone touching it. Concentrated liquidity + Low cost: Price ranges on constant-product without bin management or 0.25 SOL setup costs. Pool + position costs 0.022 SOL. Built-in farming: Most AMMs require a separate staking program to distribute rewards. DAMM v2 doesn't. Farming is native to the pool, with each pool having its own reward vault supporting up to two reward tokens. No external contracts. No extra integration. Creators fund rewards directly into the pool they created. Putting it all together, you can launch a token with decaying fees, compound a certain % of fees back, lock the position and let the pool grow from its own volume.k should only go upThe liquidity problem was never about fees existing. It was about fees leaving. Every basis point that exits the pool is a basis point that never compounds into future depth. Over thousands of trades, the difference between a compounding pool and a non-compounding pool isn't incremental. It's categorical. CollectFeeMode.Compounding makes the fee flywheel a native AMM primitive. Configurable by the creator. Enforced by the program. Executed inside the swap. No bot. No router. No dependencies. The drain doesn't need a plug. It needs to not exist.Get Started TODAYDAMM v2 Release 0.2.0 is open source, audited, and live.CollectFeeMode.Compounding (mode 2) joins the existing BothToken (0) and OnlyB (1) modes.Fee accounting splits tradingFee into claimingFee + compoundingFee.A LiquidityHandler abstraction dispatches math based on fee mode.Create your first compounding pool with the TypeScript SDK: npmjs.com/package/@meteora-ag/cp-amm-sdk Documentation: https://docs.meteora.ag/developer-guide/guides/damm-v2/overview Credits to @sudoku_defi for architecting and shipping this upgrade. ❤ ## Publication Information - [Buidling Onchain](https://blog.dannwee.xyz/): Publication homepage - [All Posts](https://blog.dannwee.xyz/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@dannweeeee): Subscribe to updates - [Twitter](https://twitter.com/dannweeeee): Follow on Twitter - [Farcaster](https://farcaster.xyz/0xbaseddann.eth): Follow on Farcaster