Explanation of DAMM V2 Mechanics

Table of Contents

Introduction to DAMM V2

DAMM V2, or Dynamic Automated Market Maker Version 2, is an advanced constant-product Automated Market Maker (AMM) protocol developed by Meteora on the Solana blockchain. It serves as a liquidity pool program designed to facilitate token swaps while providing enhanced flexibility for liquidity providers (LPs), token launches, and traders. Unlike traditional AMMs, DAMM V2 incorporates features like dynamic fees, concentrated liquidity, and position NFTs to optimize capital efficiency, reduce risks like sniping during launches, and enable new DeFi strategies. It is a completely new program (with its own ID: cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG), not an upgrade of DAMM V1, and focuses on memecoins and high-volatility assets.

Visual: Constant Product Bonding Curve

DAMM V2 uses a constant-product formula (x * y = k) for pricing, where x and y are token reserves, and k is constant. This creates a hyperbolic bonding curve for price discovery.

Key Features

DAMM V2 introduces several innovations to address limitations in earlier AMMs:

Visual: Fee Scheduler Decay

Here's an illustration of linear vs. exponential fee decay starting from 50% over 10 time units (e.g., minutes).

Visual: Concentrated Liquidity Distribution

This bar chart represents liquidity concentrated in specific price bins (ranges), showing higher density around the current price for efficiency.

Additional technical enhancements include unique accounts per pool to fix "hot account" issues (shared accounts in V1 causing bottlenecks) and no auto-compounding of fees, which unlocks features like single-token fee claims.

How It Works for Liquidity Providers (LPs)

LPs deposit tokens into a pool to earn fees from swaps:

  1. Adding Liquidity: Select a pool, deposit base/quote tokens (system calculates the ratio). Adjust slippage tolerance. Receive a Position NFT representing your share. Multiple deposits to the same pool merge into one position unless separate NFTs are used.
  2. Earning and Claiming Fees: Fees accumulate separately (not compounded). Claim via the NFT—either in both tokens or quote-only mode. View metrics like total deposits, position value, and accrued fees in USD.
  3. Locking Liquidity: Choose permanent lock (type confirmation phrase) or vesting (set start date, duration, cliff). Locked portions remain fee-earning but principal is restricted.
  4. Withdrawing: Burn the NFT to remove liquidity, receiving tokens based on current ratios (with slippage settings).
  5. Position Management: Transfer NFTs between wallets; add/remove liquidity via instructions like add_liquidity or remove_liquidity. Each NFT tracks unlocked, locked, and vested liquidity states.

LPs benefit from concentrated ranges for higher yields in volatile markets and farming rewards claimed via claim_reward.

Visual: LP Workflow

A simplified flow using a line chart with annotations to represent steps (conceptual; steps progress over "time").

How It Works for Traders

Traders swap via integrated DEXs (e.g., Jupiter):

This setup ensures efficient price discovery with reduced slippage in concentrated ranges.

Fee Structures

Fees are modular and non-compounding:

Component Description Range/Example
Base Fee Fixed minimum per swap 0.25%–2% (customizable)
Dynamic Fee Volatility-based adder Boosts during high activity
Fee Scheduler Launch anti-sniper Starts at 50%, decays (linear/exponential) over seconds/minutes
Protocol Fee Share to Meteora/partners 20% of LP fee
Referral Fee Optional integrations Percentage of total fees
Collection Mode LP receipt Both tokens or quote-only (immutable post-creation)

LP Fee = Base + Dynamic. Total fees shown in 24h metrics.

Position Management

Positions are NFTs created via create_position and funded separately. They support:

Differences from DAMM V1

DAMM V2 is more modular and efficient:

Technical Details

Built with Anchor (Rust), DAMM V2 uses config keys for pool setup (static for predefined params, dynamic for authority-only). LP token calculation involves square root prices (e.g., lp_token = (pool.current_sqrt_price - pool.min_sqrt_price) / amount_b). Audited for security, it prioritizes scalability with unique accounts per pool.