Skip to main content
This page summarizes the amm program and the damm-v1-sdk account helpers. For exact generated layouts, use the bundled IDL and TypeScript types exported by @meteora-ag/dynamic-amm-sdk.

PDA Map

DAMM v1 sorts token mint public keys lexicographically for permissionless pool PDAs. The helpers call the larger key first and the smaller key second. Permissioned pools use an arbitrary signer account for the pool address rather than a pool PDA.

Constants

Enums

Pool

Pool is the primary DAMM v1 state account.

Config

Config defines config-based constant-product launch pools. The TypeScript SDK exposes createConfig, getPoolConfig, getFeeConfigurations, and getPoolConfigsWithPoolCreatorAuthority.

LockEscrow

LockEscrow tracks LP tokens locked for an owner and the fee value accrued by locked LP.

Operator

Operator is a zero-copy admin-created permission account.

Nested Types

Dynamic Vault Relationship

DAMM v1 does not hold all pool token inventory directly in the Pool account. Each token side uses a Dynamic Vault account: A version 1 vault stores version, total_lp_supply, and _padding0 in the last legacy strategy slot. MAX_STRATEGY is 29. The account size and the offsets of later fields are unchanged. Version 0 still prices vault shares with the vault LP mint supply. swap, add_balance_liquidity, add_imbalance_liquidity, remove_liquidity_single_side, lock, claim_fee, bootstrap_liquidity, get_pool_info, and permissionless pool initialization read vault LP supply with VaultUtils::get_vault_lp_supply: vault.total_lp_supply when version == 1, otherwise the vault LP mint supply. A version 1 vault whose total_lp_supply is below the mint supply returns InvalidVaultLpSupplyAccounting (6065). Pool LP shares use pool.lp_mint_supply. Add, remove, lock, claim_fee, and get_pool_info return LpMintSupplyAccountingNotPatched (6063) when that field is below lp_mint.supply. The program has no instruction that raises it to the mint supply. Quote engines must read the pool, both Dynamic Vault accounts, both vault token accounts, both vault LP mints, both pool vault-LP token accounts, the clock sysvar, and any depeg/stake accounts required by the curve. Pass pool.lp_mint_supply as the pool LP supply. Pass getVaultLpSupply(vault, lpMint.supply) as each vault LP supply.