Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

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.
AccountSDK or Rust helperSeeds
Permissionless poolderivePoolAddress(...), derive_permissionless_pool_keycurve type byte, sorted mints
Permissionless pool with fee tierderivePoolAddress(...), derive_permissionless_pool_key_with_fee_tiercurve type byte, sorted mints, optional little-endian trade-fee bps
Config-based constant-product poolderivePoolAddressWithConfig(...), derive_permissionless_constant_product_pool_with_config_keysorted mints, config
Customizable constant-product poolderiveCustomizablePermissionlessConstantProductPoolAddress(...), derive_customizable_permissionless_constant_product_pool_keypool, sorted mints
ConfigderiveConfigPda(index, programId)config, little-endian u64 index
LP mintderive_lp_mint_key(pool)lp_mint, pool
Vault A/B LP token accountderive_vault_lp_key(vault, pool)vault, pool
Protocol fee token accountderiveProtocolTokenFee(pool, mint, programId)fee, token mint, pool
Lock escrowderiveLockEscrowPda(pool, owner, programId)lock_escrow, pool, owner
Operatorsource helperoperator, whitelisted address
LP mint metadataderiveMintMetadata(lpMint)Metaplex metadata, metadata program, LP mint
Permissioned pools use an arbitrary signer account for the pool address rather than a pool PDA.

Constants

ConstantValueUse
PROGRAM_IDEo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaBDeployed DAMM v1 program.
STAGING_PROGRAM_IDammbh4CQztZ6txJ8AaQgPsWjd6o7GhmvopS2JAo5bCBStaging program compiled behind the staging feature.
FEE_DENOMINATOR100_000Trade, protocol, host, and partner fee denominator.
MAX_FEE_BPS1500Max trade fee for program validation, equal to 15%.
MEME_MIN_FEE_BPS / MEME_MAX_FEE_BPS25 / 1500Customizable pool fee bounds, equal to 0.25% through 15%.
FEE_NUMERATOR_DIVISIBLE_FACTOR50Customizable fee numerator must be divisible by 50.
MAX_PARTNER_FEE_NUMERATOR50_000Max partner share of protocol fee, equal to 50%.
HOST_TRADE_FEE_NUMERATOR20_000Referral host share of protocol fee, equal to 20%.
PERMISSIONLESS_AMP100Stable-pool amplification for permissionless stable pools.
MAX_AMP10_000Max stable-swap amplification coefficient.
MIN_CHANGE_AMP_DURATION600 secondsMinimum time between stable amp updates.
SLOT_BUFFER9000 slotsMainnet slot-based pre-activation buffer.
TIME_BUFFER3600 secondsMainnet timestamp-based pre-activation buffer.
MAX_ACTIVATION_SLOT_DURATIONSLOT_BUFFER * 24 * 31Max future slot activation duration.
MAX_ACTIVATION_TIME_DURATIONTIME_BUFFER * 24 * 31Max future timestamp activation duration.
QUOTE_MINTSSOL, USDCQuote mints allowed for alpha-vault launch-pool paths on mainnet builds.

Enums

EnumValues
PoolTypePermissioned, Permissionless.
ActivationType0 slot, 1 timestamp.
CurveTypeConstantProduct, Stable { amp, token_multiplier, depeg, last_amp_updated_timestamp }.
DepegTypeNone, Marinade, Lido, SplStake.
OperatorPermission0 claim protocol fee, 1 zap protocol fee.

Pool

Pool is the primary DAMM v1 state account.
FieldUse
lp_mintPool LP token mint. The LP mint authority is the vault-LP signer PDA.
token_a_mint, token_b_mintPool token mints.
a_vault, b_vaultDynamic Vault accounts that hold token A and token B inventory.
a_vault_lp, b_vault_lpProgram-owned token accounts holding each Dynamic Vault LP token.
a_vault_lp_bumpBump used for the vault-LP signer PDA.
enabledSwap and liquidity access flag. Disabled pools still allow balanced withdrawal.
protocol_token_a_fee, protocol_token_b_feeProtocol fee token accounts.
fee_last_updated_atTimestamp of last fee update.
feesPoolFees trade and protocol fee fractions.
pool_typePermissioned or permissionless pool classification.
stakeStake/depeg account used by LST stable pools when configured.
total_locked_lpTotal LP amount locked through DAMM v1 lock escrow logic.
bootstrappingLaunch-pool activation point, whitelisted vault, and activation type.
partner_infoPartner fee authority and pending partner fee balances.
paddingReserved bytes for future layout compatibility.
curve_typeConstant product or stable-swap curve parameters.

Config

Config defines config-based constant-product launch pools.
FieldUse
pool_feesTrade and protocol fee fractions applied to pools created from the config.
activation_durationDuration added to the current slot or timestamp to derive the default activation point.
vault_config_keyAlpha Vault config or base key. Default pubkey means no alpha vault.
pool_creator_authorityIf default, the config is public. If non-default, only this signer can create pools from the config.
activation_type0 slot or 1 timestamp.
partner_fee_numeratorPartner share of protocol fee using FEE_DENOMINATOR.
_paddingReserved bytes.
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.
FieldUse
poolDAMM v1 pool.
ownerOwner entitled to the locked LP fee stream.
escrow_vaultSPL token account that stores locked pool LP tokens.
bumpLock escrow PDA bump.
total_locked_amountLocked LP amount after fee accrual adjustments.
lp_per_tokenVirtual-price checkpoint used to derive unclaimed LP fee.
unclaimed_fee_pendingPending LP-denominated fee amount.
a_fee, b_feeLifetime token A and token B fees claimed from this escrow.

Operator

Operator is a zero-copy admin-created permission account.
FieldUse
whitelisted_addressAddress authorized for the permission bitmap.
permissionu128 bitmap. Bit 0 allows protocol fee claiming. Bit 1 allows zap protocol fee.
paddingReserved bytes.

Nested Types

TypeFieldsUse
PoolFeestrade_fee_numerator, trade_fee_denominator, protocol_trade_fee_numerator, protocol_trade_fee_denominatorTrade fee and protocol share of trade fee.
PartnerInfofee_numerator, partner_authority, pending_fee_a, pending_fee_bOptional partner fee state for config-created pools.
Bootstrappingactivation_point, whitelisted_vault, deprecated pool_creator, activation_typeLaunch-pool activation and alpha-vault access state.
TokenMultipliertoken_a_multiplier, token_b_multiplier, precision_factorStable-swap decimal normalization.
Depegdepeg_type, base_virtual_price, base_cache_updatedLST/depeg virtual price data.
CustomizableParamstrade_fee_numerator, activation_point, has_alpha_vault, activation_type, paddingParameters for customizable constant-product pools.
ConfigParametersfee numerators, activation fields, vault config, creator authority, index, partner feeParameters used by create_config.

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:
AccountRole
a_vault, b_vaultDynamic Vault state accounts for token A and token B.
a_token_vault, b_token_vaultToken accounts owned by each Dynamic Vault.
a_vault_lp_mint, b_vault_lp_mintDynamic Vault LP mints.
a_vault_lp, b_vault_lpDAMM v1 pool-owned Dynamic Vault LP token accounts.
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.