dynamic-amm program crate included in damm-v1-sdk/programs/dynamic-amm. CPI builders must pass the same pool, Dynamic Vault, token, mint, and remaining accounts required by the on-chain instruction.
Dependency Setup
The local program crate exposes CPI types through its defaultcpi feature.
Source Examples
Public CPI Examples
Meteora’s public CPI examples include DAMM v1 swap, pool initialization, config-based initialization, lock liquidity, claim fee, and tests.
damm-v1-sdk/common crate also contains account builders that are useful when preparing CPI or off-chain instruction account sets.
Account Planning
Every DAMM v1 CPI has two account layers:
Use
common::dynamic_amm::pda and common::dynamic_vault::pda helpers to derive canonical addresses.
Swap CPI
swap takes in_amount and minimum_out_amount.
Liquidity CPI
Liquidity instructions need pool LP mint, user token accounts, user pool LP account, both Dynamic Vault accounts, vault token accounts, vault LP mints, and pool-held vault LP token accounts.
Lock CPI
Lock fee accounting depends on current pool virtual price. Pass fresh vault and LP account data so the instruction can compute the correct fee.
Pool Creation CPI
Pool creation CPI is possible but account-heavy because it initializes the pool, LP mint, pool-held vault LP accounts, protocol fee accounts, payer LP ATA, and LP metadata.
For most CPI use cases, initialize pools off-chain first and CPI only into swap, liquidity, or lock flows.

