ποΈRocksdb states
1. Token
1.1 Token info
pub struct Token {
pub id: String, // internal identifier for this token (typically equal to mint)
pub program: String, // origin program/launchpad or DEX program
pub signature: String, // creation transaction signature
pub mint: String, // token mint address
pub quote_mint: String, // quote token mint (e.g., WSOL or USD1)
pub bonding_curve: Option<String>,// optional bonding curve id/address (pre-migration)
pub name: String, // token display name
pub symbol: String, // token ticker symbol
pub uri: String, // metadata URI
pub creator: String, // creator address (string)
pub creator_balance: f64, // creator SOL balance
pub creation_time: i64, // unix timestamp when created
pub creation_slot: u64, // slot when created
pub total_supply: f64, // total minted supply (UI units)
pub decimals: u8, // number of decimal places
pub quote_decimals: u8, // decimals for quote token (e.g., 9 for WSOL)
// Prices and liquidities are in QUOTE units; u_* are USD equivalents
pub price: f64, // price per token in quote units
pub u_price: f64, // price per token in USD
pub market_cap: f64, // market cap in quote units
pub u_market_cap: f64, // market cap in USD
pub liquidity: f64, // current liquidity (quote units)
pub u_liquidity: f64, // current liquidity (USD)
pub token_liquidity: f64, // token-side liquidity (token units)
pub u_token_liquidity: f64, // token-side liquidity (USD)
pub ath_liquidity: f64, // ath liquidity (quote units)
pub u_ath_liquidity: f64, // ath liquidity (USD)
pub ath_liq_ts: Option<i64>, // ath liquidity timestamp
pub ath_price: f64, // ath price (quote units)
pub u_ath_price: f64, // ath price (USD)
pub ath_price_ts: Option<i64>, // ath price timestamp
pub bonding_progress: f64, // progress along bonding curve (0β100)
pub curve_type: u8, // encoded bonding curve type id
// Initial reserves at creation (if available)
pub init_liq: f64, // initial quote reserves
pub u_init_liq: f64, // initial quote reserves (USD)
pub init_token_liq: f64, // initial token reserves
pub u_init_token_liq: f64, // initial token reserves (USD)
// Migration
pub migrated: bool, // whether token migrated to DEX pool
pub migrated_at: Option<i64>, // unix timestamp when migration happened
// Pool info
pub pool: Option<PoolInfo>, // pool details after migration
// Holders
pub holders_count: usize, // cached number of unique holders
pub top10_holder_percent: f64, // Top 10 holder % of total supply
pub top100_holder_percent: f64, // Top 100 holder % of total supply
pub top_holders: Vec<(String, String)>, // top holders with classification
// Trades
pub trades: u64, // total number of trades observed
pub large_trades: u64, // large trades (e.g., β₯ threshold)
// Aggregated fees (in SOL)
pub total_fee: f64,
pub priority_fee: f64,
pub tip_fee: f64,
pub trade_fee: f64,
}
pub struct PoolInfo {
pub pool_program: String, // program id of the pool
pub pool_address: String, // pool account address
pub pool_authority: String, // authority account for the pool
pub pool_mint_account: String,// token mint account for pool token
pub pool_quote_account: String,// quote token account for the pool
}1.1.1 Example: Simple
1.1.2 Example: Combining event topics and token state
1.2 Holders
1. Example:
Example 2: Combining event topics and holders state
1.3 Stats
Example 1:
Example 2: Combining event topics and trade stats state
1.4 100 first buy txs
Example 1:
Example 2: Combining event topics and early buyers state
1.5 Holders Analytics
1.5.1 Example: Simple
1.5.2 Example: Combining event topics and holder analytics state
2. Creator / Trader
2.1 Creator
Example 1:
Example 2: Combining event topics and creator state
2.2 Trader
Example 1:
Example 2: Combining event topics and trader state
Last updated