interfacePoolState{ // === Metadata ===epoch:BN;// Account update epochauth_bump:number;// Authority PDA bump seedstatus:number;// 0: Funding, 1: Migrate, 2: Trade // === Token Info ===base_decimals:number;// Token decimals (usually 6 or 9)quote_decimals:number;// WSOL decimals (always 9)migrate_type:number;// 0: AMM, 1: CPSwapsupply:BN;// Total token supplytotal_base_sell:BN;// Total tokens available for sale // === Reserves ===virtual_base:BN;// Virtual token reserves (VA)virtual_quote:BN;// Virtual SOL reserves (VB)real_base:BN;// Actual tokens in pool (RA)real_quote:BN;// Actual SOL raised (RB)total_quote_fund_raising:BN;// Fundraising goal (e.g., 30 SOL) // === Fees ===quote_protocol_fee:BN;// Accumulated protocol feesplatform_fee:BN;// Accumulated platform feesmigrate_fee:BN;// Fee for migration // === Vesting ===vesting_schedule:{total_locked_amount:BN;// Total tokens lockedcliff_period:BN;// Cliff period in secondsunlock_period:BN;// Unlock period in secondsstart_time:BN;// Vesting start timeallocated_share_amount:BN;// Allocated shares}; // === Accounts ===global_config:PublicKey;// Global config accountplatform_config:PublicKey;// Platform config accountbase_mint:PublicKey;// Token mintquote_mint:PublicKey;// WSOL mintbase_vault:PublicKey;// Token vaultquote_vault:PublicKey;// SOL vaultcreator:PublicKey;// Token creator // === Misc ===token_program_flag:number;// Token program version flagsamm_creator_fee_on:object;// AMM creator fee settingspadding:number[];// Reserved for future use}
Key Calculations
Below are common calculations derived from the PoolState fields. All code examples assume numeric conversion where BN values are used (e.g., toNumber()).
Fundraising Progress
This yields the fundraising completion percentage.
Current Price
Price computed from combined virtual+real quote reserves over effective base supply in the pool.
Market Cap
Market cap = total token supply × current price per token.
Liquidity Available
availableTokens: actual tokens in the pool (RA).
availableSOL: combined virtual and real quote reserves (VB + RB).