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 cp-amm account model. For exact layouts, use the published IDL and generated TypeScript types exported by @meteora-ag/cp-amm-sdk.

PDA Map

Pool and customizable pool PDAs sort the two mint public keys lexicographically in the seed list.
AccountSDK helperSeeds
Pool authorityderivePoolAuthority()pool_authority
Static or dynamic configderiveConfigAddress(index)config, little-endian u64 index
Config-based poolderivePoolAddress(config, tokenAMint, tokenBMint)pool, config, sorted mints
Customizable poolderiveCustomizablePoolAddress(tokenAMint, tokenBMint)cpool, sorted mints
PositionderivePositionAddress(positionNft)position, position NFT mint
Token vaultderiveTokenVaultAddress(tokenMint, pool)token_vault, mint, pool
Reward vaultderiveRewardVaultAddress(pool, rewardIndex)reward_vault, pool, reward index
Token badgederiveTokenBadgeAddress(tokenMint)token_badge, mint
Position NFT token accountderivePositionNftAccount(positionNftMint)position_nft_account, position NFT mint
Claim fee operatorderiveClaimFeeOperatorAddress(operator)cf_operator, operator
OperatorderiveOperatorAddress(whitelistedAddress)operator, whitelisted address
Event authoritygenerated clients__event_authority

Constants

ConstantValueUse
MIN_SQRT_PRICE4295048016Lower square-root price bound.
MAX_SQRT_PRICE79226673521066979257578248091Upper square-root price bound.
NUM_REWARDS2Reward slots per pool and position.
FEE_DENOMINATOR1_000_000_000Fee numerator denominator.
MAX_FEE_BPS_V05000Legacy pool-version max fee, 50%.
MAX_FEE_BPS_V19900Current pool-version max fee, 99%.
CURRENT_POOL_VERSION1Current fee version for new pools.
SPLIT_POSITION_DENOMINATOR1_000_000_000Numerator denominator for split_position2.
MIN_REWARD_DURATION86400Minimum reward campaign duration, 1 day.
MAX_REWARD_DURATION31536000Maximum reward campaign duration, 1 year.

Enums

EnumValues
CollectFeeMode0 BothToken, 1 OnlyB, 2 Compounding
PoolStatus0 Enable, 1 Disable
PoolType0 Permissionless, 1 Customizable
LayoutVersion0 V0, 1 V1
ActivationType0 Slot, 1 Timestamp
BaseFeeModeTime scheduler linear, time scheduler exponential, rate limiter, market-cap scheduler linear, market-cap scheduler exponential
SwapMode0 ExactIn, 1 PartialFill, 2 ExactOut
OperatorPermissionConfig, token badge, pool status, reward, pool fee, protocol fee, zap, and layout-fix permissions

Config

FieldMeaning
vault_config_keyAlpha-vault key that may buy before activation when configured
pool_creator_authorityIf non-default, only this authority can create pools with the config
pool_feesBase fee, dynamic fee config, protocol/referral fee percents, compounding fee bps
activation_type0 slot, 1 timestamp
collect_fee_mode0 BothToken, 1 OnlyB, 2 Compounding
config_type0 static, 1 dynamic
indexConfig index used in PDA derivation
sqrt_min_price, sqrt_max_pricePrice bounds for concentrated modes
Use fetchConfigState, getStaticConfigs, or getAllConfigs to read configs from TypeScript.

PoolFeesConfig

FieldMeaning
base_feeEncoded base fee mode and mode-specific parameters
dynamic_feeOptional volatility-responsive fee config
protocol_fee_percentProtocol share of trading fees
referral_fee_percentReferral share of protocol fee when referral is present
compounding_fee_bpsFee share that compounds into reserves for compounding pools

Pool

FieldMeaning
pool_feesRuntime fee state, including base and dynamic fee state
token_a_mint, token_b_mintPool mints
token_a_vault, token_b_vaultVault token accounts
whitelisted_vaultPre-activation alpha-vault access
liquidityTotal active liquidity
protocol_a_fee, protocol_b_feeAccrued protocol fees
sqrt_min_price, sqrt_max_price, sqrt_pricePrice bounds and current square-root price
activation_point, activation_typeLaunch activation point and unit
pool_status0 enabled, 1 disabled
token_a_flag, token_b_flagToken program/extension flags
collect_fee_modeLiquidity and fee mode
pool_typePermissionless or customizable
fee_version0 caps max fee at 50%; 1 caps max fee at 99%
fee_a_per_liquidity, fee_b_per_liquidityFee growth checkpoints as little-endian U256 bytes
permanent_lock_liquidityTotal permanently locked pool liquidity
creatorPool creator
token_a_amount, token_b_amountTracked reserves for layout version V1
layout_versionV1 pools track token reserve amounts directly
reward_infosTwo pool reward slots
Use fetchPoolState for state and fetchPoolFees when you need decoded pool fee bytes.

PoolMetrics

FieldMeaning
total_lp_a_fee, total_lp_b_feeLifetime LP fees accumulated by token side
total_protocol_a_fee, total_protocol_b_feeLifetime protocol fees accumulated by token side
total_positionCount of created positions, updated when position accounts are initialized or reduced

RewardInfo

FieldMeaning
initializedNon-zero when a reward slot is initialized
reward_token_flagToken program flag for the reward mint
mint, vault, funderReward mint, reward vault, and funder authority
reward_duration, reward_duration_endCampaign duration and end timestamp
reward_rateEmission rate in Q64-scaled reward units
reward_per_token_storedCumulative reward growth checkpoint as little-endian U256 bytes
last_update_timeLast pool reward update timestamp
cumulative_seconds_with_empty_liquidity_rewardCarry-forward accounting when rewards accrue while liquidity is empty

Position

FieldMeaning
poolPool address
nft_mintPosition NFT mint
fee_a_per_token_checkpoint, fee_b_per_token_checkpointFee checkpoints as little-endian U256 bytes
fee_a_pending, fee_b_pendingClaimable pending fees
unlocked_liquidityWithdrawable liquidity
vested_liquidityLiquidity locked by vesting
permanent_locked_liquidityLiquidity that cannot be withdrawn
reward_infosUser reward checkpoints and pending rewards for two reward slots
inner_vestingEmbedded vesting schedule used by newer lock flows
The position NFT is the ownership handle. A position operation that changes liquidity or claims fees verifies the owner through the NFT token account.

PositionMetrics

FieldMeaning
total_claimed_a_fee, total_claimed_b_feeLifetime claimed fee counters for the position

UserRewardInfo

FieldMeaning
reward_per_token_checkpointLast synced pool reward growth checkpoint
reward_pendingsClaimable pending reward amount
total_claimed_rewardsLifetime claimed rewards for the reward slot

InnerVesting

FieldMeaning
cliff_pointSlot or timestamp when cliff unlock begins
period_frequencySlot or timestamp interval between unlock periods
cliff_unlock_liquidityLiquidity released at the cliff
liquidity_per_periodLiquidity released per period after the cliff
total_released_liquidityLiquidity already released into unlocked liquidity
number_of_periodNumber of post-cliff unlock periods

Rewards And Vesting

Each pool has up to two RewardInfo slots. Once initialized, a reward slot remains initialized. Each position has matching UserRewardInfo checkpoints. External Vesting accounts are still supported and are 176 byte zero-copy accounts keyed by position. inner_vesting stores one vesting schedule inside the Position account and lets integrations lock liquidity without creating a separate vesting account. Use the SDK lock and refresh helpers unless you are building low-level instructions.

Token Badges

TokenBadge is a 160 byte account that records the mint for Token 2022 mints requiring review. See Token 2022 support for product behavior and supported extension categories.