Pool State

You can decode the pool state using the IDL or the SDK. The pool state contains all the information about the pool, including the tokens, reserves, fees, and other parameters.
state.rs
pub struct LiquidityPoolState {
    pub info: LiquidityPoolInfo,
    pub market_cap_based_fees: LiquidityPoolMarketCapBasedFees,
    pub reserve: LiquidityPoolReserve,
    pub lp_token: LiquidityPoolLpTokenInfo,

    pub protocol_trading_fees: u64,
    pub creator_trading_fees: u64,
    pub creator_trading_fees_claimed_by_creator: u64,
    pub creator_trading_fees_claimed_by_others: u64,
    pub liquidity_provider_trading_fees: u64,
    pub creator_trading_fee_protocol_fees: u64,
    pub reflection_trading_fees: u64,
    pub created_at_slot: u64,
    pub trading_volume_usd: f64,
    pub creator_trading_fee_trading_volume_threshold: f64,
    pub creator_trading_fee_trading_volume_threshold_reached_unix_timestamp: u64,

    pub token_a_vault: Pubkey,
    pub token_b_vault: Pubkey,
    pub protocol_config: Pubkey,
    pub key: Pubkey,

    pub token_a: LiquidityPoolTokenInfo,
    pub token_b: LiquidityPoolTokenInfo,
    pub permissions: LiquidityPoolPermissions,
    pub feature_flags: LiquidityPoolFeatureFlags,

    pub taxable_side: u8,
    pub taxable_side_type: u8,
    pub creator_trading_fee_distribution: u8,
    pub creator_trading_fee_claim_status: u8,
    pub fee_configuration_mode: u8,

    pub is_migrated: u8,
    _pad: [u8; 13],
    pub slot_offset_based_fees: LiquidityPoolSlotOffsetBasedFees,
    pub creator_trading_fee_receiver: Pubkey,
}

Key Information

  • Fees
    • protocol_trading_fees: Total Protocol Fee collected.
    • creator_trading_fees: Total Creator Fee collected.
    • creator_trading_fees_claimed_by_creator: Total Creator Fee claimed by the creator.
    • creator_trading_fees_claimed_by_others: Total Creator Fee claimed by others.
    • liquidity_provider_trading_fees: Total liquidity provider trading fees collected.
    • creator_trading_fee_protocol_fees: Total Creator-Protocol Fee collected.
    • reflection_trading_fees: Total Reflection Fee collected.
  • Creator Fee Claim Status
    • creator_trading_fee_claim_status: Indicates if the creator fee verification is pending or completed.
      • 0: Unclaimed - The default state when the pool is created.
      • 1: Submitted - The creator has submitted an application for verification.
      • 2: Processed - The application has been processed.
  • Trading Volume
    • trading_volume_usd: The current trading volume (buy/sell) in USD.
    • creator_trading_fee_trading_volume_threshold: The threshold for Creator Fee claim.
    • creator_trading_fee_trading_volume_threshold_reached_unix_timestamp: Timestamp when the threshold was reached.
  • Creator Fee Distribution
    • creator_trading_fee_distribution: Indicates how the Creator Fee is to be distributed.
      • 0: Community - By default, the fee is distributed to the community as additional reflections.
      • 1: Creator - A creator can submit verification to claim the fee. Once approved, creator_trading_fee_distribution is set to 1.
      • 2: Blocked - Cannot be claimed by creator.
      • 3: Shared - The fee is split between the creator and the flywheel.
  • Migration
    • You can use the is_migrated field to check if the pool has been migrated to the new version of the protocol.
      • 0: Not migrated
      • 1: Migrated