Skip to main content
The amm IDL exposes many instructions. Integrators can choose to either use the TypeScript SDK for transaction construction or build through CPI.

Pool Creation

Pool initialization creates or initializes the pool, LP mint, pool-owned Dynamic Vault LP token accounts, protocol fee token accounts, initial liquidity, and LP mint metadata. The two Dynamic Vault accounts and their token vaults must exist or be created as part of the setup flow.

Pool PDA Variants

Use the SDK or Rust helper derivations instead of rebuilding seeds manually.

Swaps

swap validates pool enablement and launch activation, updates depeg virtual price when required, deposits input through one Dynamic Vault, computes trade, protocol, partner, and optional host fees, then withdraws output through the opposite vault.

Liquidity

Balanced operations are the normal constant-product path. Stable pools additionally support imbalanced deposits and single-sided withdrawals.

LP Locks

Lock fee accounting is LP-denominated internally. Claiming converts claimable LP value into token A/B by using the pool’s balanced withdrawal logic.

Configs And Activation

Config-created pools inherit pool_fees, activation_duration, vault_config_key, pool_creator_authority, activation_type, and partner_fee_numerator. If pool_creator_authority is not the default pubkey, that authority must sign pool creation from the config.

Pool Controls And Fees

trade_fee_numerator, protocol_trade_fee_numerator, host fee, and partner fee values use FEE_DENOMINATOR = 100_000, not direct basis points.

Operator And Admin Instructions

Operator permissions are stored as a bitmap. Bit 0 allows protocol fee claiming, and bit 1 allows protocol fee zapping.

Validation