Skip to main content
This page summarizes the account model used by lb_clmm. For exact layouts, use the IDL and generated TypeScript types exported by @meteora-ag/dlmm.

PDA Map

Pool and reserve PDAs sort the two mint public keys lexicographically.

Constants

Bin array index for a bin ID: floor(bin_id / 70), with extra adjustment for negative remainders. Each bin array covers 70 consecutive bin IDs.

LbPair

LbPair is the root pool account.

Fee parameters

StaticParameters fields: VariableParameters tracks volatility_accumulator, volatility_reference, index_reference, and last_update_timestamp for dynamic fees.

Pool identity and reserves

Status, type, and activation

Rewards, oracle, and bitmap

Each RewardInfo is initialized when mint != default. The funder must match funder or be protocol admin.

Token program flags

BinArray and Bin

BinArray

BinArray stores 70 Bin entries for one bin-array index. PDA: ["bin_array", lb_pair, index.to_le_bytes()].

Bin

Each Bin holds liquidity, pricing, swap-fee growth, and limit-order state for one price bin. For liquidity-mining pools, reward growth checkpoints are packed into select bin fields at runtime; read pool function_type and reward state together when decoding bins for LM pools.

BinArrayBitmapExtension

BinArrayBitmapExtension extends the pool bitmap beyond the default ±512 bin-array index range. Required when operating on bin arrays outside LbPair::bitmap_range() (−512…511). Swaps and liquidity updates that cross this range must pass the extension account or the program returns BitmapExtensionAccountIsNotProvided. PDA: ["bitmap", lb_pair].

PositionV2

PositionV2 is the current LP position format.

Fixed header

Nested types

FeeInfo per bin: UserRewardInfo per bin:

Dynamic extension

Positions wider than 70 bins append PositionBinData after the header: Use increase_position_length / decrease_position_length (or v2 variants) to resize. PDA seeds include lower_bin_id and width (number of bins, not upper_bin_id).

Position (legacy)

Position uses a smaller integer type for liquidity shares instead of the current one. Migrate to PositionV2 with migrate_position_from_v1 / migrate_position_from_v2. New positions should use initialize_position / initialize_position2.

LimitOrder

LimitOrder supports limit-order pools (function_type limit order).

Per-bin extension

Close empty accounts with close_limit_order_if_empty. Up to 50 bins.

Oracle

Oracle stores a fixed metadata header plus a dynamic Observation ring buffer.

Metadata

Observation (each sample)

PDA: ["oracle", lb_pair].

PresetParameter (legacy)

PresetParameter is the legacy pool-creation preset keyed by bin_step only. PDA: ["preset_parameter", bin_step.to_le_bytes()]. Prefer PresetParameter2 for new integrations.

PresetParameter2

PresetParameter2 is the current admin-configured preset. min_bin_id / max_bin_id are derived from bin_step at pool creation. PDA: ["preset_parameter2", index.to_le_bytes()].

TokenBadge

TokenBadge records an admin-approved Token-2022 mint. Required in pool creation when a Token-2022 mint has restricted extensions. PDA: ["token_badge", mint].

Token-2022 in transactions

Pools with token_mint_*_program_flag = 1 use Token-2022. When building custom instructions, include remaining accounts required by mint extensions (transfer hooks, transfer fees, and so on). The SDK resolves token program IDs and hook metas from mint accounts.