Config Types
DAMM v2 pools are created from a config account that pre-defines pool parameters. Two config types exist:
Static Config
Dynamic Config
Parameters are fixed when the config is created. All pools created from a static config inherit the same:
- Fee structure (base fee mode, dynamic fee, protocol fee %)
collect_fee_mode (BothToken / OnlyB / Compounding)
activation_type (slot or timestamp)
- Price range (
sqrt_min_price, sqrt_max_price)
Best for: Launchpads and protocols that want uniform pool settings across all their pools. Pool creators define custom parameters at pool creation time. Only available for private configs (permissioned via pool_creator_authority).Configurable per-pool:
- Fee structure
collect_fee_mode
activation_type and activation_point
- Price range
- Alpha vault settings
Best for: Protocols that need per-pool customization (Meteora Invent, custom launchpads).
Activation Types
Each pool can gate trading behind an activation point:
activation_type | Value | Description |
|---|
Slot | 0 | Trading opens at a specific Solana slot number |
Timestamp | 1 | Trading opens at a specific Unix timestamp |
Before the activation point, swaps are disabled. Only whitelisted vault programs (Alpha Vault) can trade.
Setting activation_point: null (or 0) opens the pool for trading immediately.
Price Range
Every pool has a configured price range defined by:
| Parameter | Type | Description |
|---|
sqrtMinPrice | u128 | Lower bound of the price range (as √price × 2^64) |
sqrtMaxPrice | u128 | Upper bound of the price range (as √price × 2^64) |
initSqrtPrice | u128 | Starting price at pool creation |
Full Range vs Concentrated
| Mode | sqrtMinPrice | sqrtMaxPrice |
|---|
| Full range (x·y=k) | MIN_SQRT_PRICE | MAX_SQRT_PRICE |
| Concentrated | Custom lower | Custom upper |
CollectFeeMode.Compounding (mode 2) requires full range. The SDK enforces MIN_SQRT_PRICE / MAX_SQRT_PRICE for compounding pools.
Converting Price to √Price
sqrtPrice = √(tokenB_per_tokenA) × 2^64
The TypeScript SDK provides getSqrtPriceFromPrice(price, decimalsA, decimalsB) for this conversion.
Pool Creation Parameters
When calling createCustomPool, the key parameters are:
| Parameter | Type | Description |
|---|
tokenAMint | PublicKey | Base token mint |
tokenBMint | PublicKey | Quote token mint (must be SOL or USDC for public configs) |
tokenAAmount | BN | Initial base token deposit |
tokenBAmount | BN | Initial quote token deposit (0 for one-sided) |
sqrtMinPrice | BN | Lower price bound |
sqrtMaxPrice | BN | Upper price bound |
initSqrtPrice | BN | Initial pool price |
liquidityDelta | BN | Initial liquidity (calculated from amounts) |
collectFeeMode | CollectFeeMode | 0 = BothToken, 1 = OnlyB, 2 = Compounding |
activationType | ActivationType | 0 = Slot, 1 = Timestamp |
activationPoint | BN | null | When trading opens (null = immediate) |
hasAlphaVault | boolean | Whether an alpha vault is associated |
poolFees | PoolFeesParams | Full fee configuration |
Pool State
On-chain, a pool account stores:
| Field | Type | Description |
|---|
liquidity | u128 | Current total liquidity in the active range |
sqrtPrice | u128 | Current √price |
sqrtMinPrice | u128 | Pool price range lower bound |
sqrtMaxPrice | u128 | Pool price range upper bound |
tokenAAmount | u64 | Token A reserves |
tokenBAmount | u64 | Token B reserves |
collectFeeMode | u8 | Fee collection mode |
activationPoint | u64 | Trading activation point |
poolStatus | u8 | Pool enabled/disabled status |
poolType | u8 | 0 = SPL Token, 1 = Token 2022 |
feeAPerTokenStored | [u8; 32] | Cumulative fee A per unit liquidity (U256) |
feeBPerTokenStored | [u8; 32] | Cumulative fee B per unit liquidity (U256) |
rewardInfos | [RewardInfo; 2] | Farming reward state (2 slots) |
metrics | PoolMetrics | Cumulative swap/liquidity stats |
Token 2022 Support
DAMM v2 supports Token 2022 mints. When creating a pool with Token 2022 tokens, the program automatically detects and handles:
- Transfer fee extension — Fee amounts are accounted for in
transfer_fee_included / transfer_fee_excluded fields
- Interest-bearing — Scaled amounts handled correctly
- Other extensions — Compatible with all standard Token 2022 extensions
Native mint (So11111111111111111111111111111111111111112) with Token 2022 is not supported (UnsupportNativeMintToken2022 error).
The token_a_flag and token_b_flag on pool state indicate which token program each mint uses.