DAMM v2 Overview
Summary
Dynamic AMM v2 (DAMM v2) is a brand new constant-product AMM program for liquidity pools, with a set of features to optimize transaction fees and provide greater flexibility for liquidity providers, launchpads, and token launches.
Note: DAMM v2 is a new program, and not an upgrade of the Dynamic AMM v1 program.
Key Features
DAMM v2 would come with the following features.
Support for a wider range of tokens: SPL and Token 2022
Dynamic Fee: Option of Fixed Base Fee only or with Dynamic Fee, which helps maximize returns during periods of higher volatility
Anti-Sniper LP Fee Scheduler: Option of an On-chain Fee scheduler where swap fee starts higher and drops over time (linearly or exponentially), as an anti-sniper mechanism
Versatile LP Fee claiming mechanism: LP Fee doesn't auto-compounds into the pool liquidity. Can be claimed separately from liquidity withdrawal. This allows the building of additional features into the fee distribution system
LP Fee collection mode: Ability to select your preferred token for LP fee collection; Base + Quote or Quote token only
Transferrable Position NFT: Liquidity position is not represented by an LP Token, but by a Position NFT, so ownership can be transferred to another wallet if required
Lock liquidity options: Option to lock liquidity with vesting (non-permanent lock) or permanently lock liquidity, while still providing the ability to claim fees
Concentrated liquidity: Ability to partially concentrate liquidity within a configured min-max price range for higher capital efficiency. Note: This feature is currently only available on permissioned pools created by the team.
Launch single-sided liquidity: To launch their token, projects can programmatically create single-sided liquidity pools with only 1 token, similar to DLMM, offering greater flexibility for launches
Built-in Farming mechanism: Built-in farming within the program, not a separate Farm program
Greater cost efficiency:
No Dynamic Vault integration (which DAMM v1 has) to lend tokens to external lending protocols, so DAMM v2 no longer involves hot accounts
CU-optimized
Lower SOL rent costs
Creating a single DAMM v2 pool + position costs ~0.022 SOL, compared to an average of ~0.25 SOL for binArrays and Positions on the DLMM pool
Custom start time (pool activation time): A custom start time can be set during pool creation, so that you can launch your token at the specific time you want
SPL and Token 2022 support
Users can create pools or add liquidity for tokens that support both SPL and Token 2022 (Transfer Fee, Metadata, MetadataPointer extensions).
All Token 2022 tokens with Metadata pointer, and transfer fee extensions are supported permissionlessly. Token mints with other extensions can be whitelisted by Meteora's admin.
Dynamic Fee
Pool creator has the option of choosing a Fixed Base Fee only or with an additional Dynamic Fee, which is a variable fee based on price volatility.
Dynamic Fee helps maximize returns for LPs during periods of higher volatility.
DAMM v2 Dynamic Fee Calculation
dynamic_fee_numerator = ((volatilityAccumulator*binStep)^2 * variableFeeControl + 99_999_999_999) / 100_000_000_000
dynamic_fee_percent = (dynamic_fee_numerator / 1_000_000_000) * 100
By default
binStep = 1
variableFeeControl
: This value will be set in dynamic fee params when a creator creates a pool. It is a constant value stored inside poolState.
Max Dynamic Fee on DAMM v2
Currently, the max Dynamic Fee is ~20% of the Base Fee. It will always be <= Base Fee
Example:
Base Fee = 0.25%
Dynamic Fee = 0.0499%
Total LP Fee = 0.2999%
LP Fee Scheduler
Pool creator has the option of using an On-chain Fee Scheduler, where LP Fees can drop over time (linearly or exponentially). This acts as an anti-sniper mechanism as you can set higher fees at the very start of the token launch.
By default, LP Fees drop over time per second. But partners using the pool creation setup script have the following options:
Time based (unix timestamp): Fees change per second
Slot based: Fees change per slot (1 slot = 1 block = 0.4 secs)
Linear Fee Scheduler Example
Exponential Fee Scheduler Example
Versatile LP Fee Claiming mechanism
LP Fee no longer auto-compounds into the pool liquidity. Can be claimed separately from liquidity withdrawal. This allows the building of additional features into the fee distribution system. For example, enabling the claiming of LP Fee in a preferred token (e.g. SOL or USDC), or locking liquidity position permanently but still allow fees to be claimed.
LP Fee Collection Mode
Pool creator has the ability to select your preferred token for LP Fee Collection: Base + Quote or Quote token only.
Regarding how DAMM 2 collects fee only using the Quote token ("Token B"):
If a user swaps from A -> B, fee is charged on B; protocol takes some of the user's B
If a user swaps from B -> A, fee is charged on B before the swap is calculated; protocol takes some of the user's B before it gets swapped to A
Transferrable Position NFT
Liquidity position is not represented by an LP Token, but by a position NFT. This position NFT can be transferred to another wallet address.
Concentrated Liquidity
DAMM v2 is a constant product pool but still enables pool creators to partially concentrate liquidity using a slightly tighter price range for higher capital efficiency. Once the pool is created, LPs that enter the pool would not be able to adjust the price range. This feature combines the benefits of a constant product AMM with the concentrated liquidity feature of a CLMM.
Lock Liquidity Options
Pool creator has the option to lock liquidity with vesting (non-permanent lock) or permanently lock liquidity.
Launch single-sided liquidity
Project launches can programmatically create single-sided liquidity pools with only 1 token, similar to DLMM, offering greater flexibility for launches
Built-in Farming mechanism
There is now built-in farming within the program, not using a separate Farm program like in Dynamic AMM v1.
Greater cost efficiency
Unlike DAMM v1, DAMM v2 is not integrated with Dynamic Vaults to lend tokens to external lending protocols. Each pool now includes a set of unique accounts for swap instruction; there are no more hot accounts or shared accounts between 2 pools, which optimizes the Compute Unit (CU) and lower transaction fees and rent required.
Creating a single DAMM v2 pool + position costs ~0.022 SOL, compared to an average of ~0.25 SOL for binArrays and Positions on the DLMM pool.
Custom start time (pool activation time)
A custom start time can be set during pool creation, so that you can launch your token at the specific time you want, to coincide with your CEX listing or token airdrop claim etc.
Case Studies
DAMM v2 Integration
Last updated