Database tables
In the following section, we’ll outline what the database tables consist of, detailing the key components and data structures that power our Solana transaction indexer.
Solana Transaction Indexer Database Documentation
Overview
This document outlines the database tables that power our Solana transaction indexer, detailing the key components and data structures. The system consists of the following tables:
solana_mints
- New Solana tokens (excluding Pump.fun tokens)raydium_all_swaps
- Raydium transactionspumpfun_token_creation
- New Solana tokens on Pump.funpumpfun_all_swaps
- Pump.fun transactionspumpswap_all_swaps
- PumpSwap transactionspfamm_migrations
- PumpFun AMM migration transactionsmeteora_swaps
- Meteora DLMM DEX swap transactionsraydium_launchpad_swaps
- Raydium Launchpad transactionsraydium_launchpad_migrations
- graduations from the Raydium launchpad.
Common Column Structure
Many tables share similar fields, particularly for transaction identification:
Time and Transaction Identifiers
block_time
DateTime
Timestamp when the block containing the transaction was processed
block_date_utc
/ block_date
Date
Date of the block in UTC timezone (truncated to day)
slot
UInt32/UInt64
Solana blockchain slot number
tx_idx
UInt16/UInt32
Index of the transaction within the block
signature
String
Unique Solana transaction signature
Wallet Information
signing_wallet
/ user
String
The wallet that signed the transaction
fee_payer
String
The wallet that paid for the transaction fees
from_wallet
String
Original wallet that initiated a transaction (when different from signing wallet)
Gas and Execution Information
provided_gas_fee
UInt64
Gas price set by the user for the transaction
provided_gas_limit
UInt64
Gas limit set by the user for the transaction
fee
/ fee_paid
UInt64
Actual transaction fee paid
consumed_gas
UInt64
Actual compute units consumed by the transaction
Common Table Configuration
Most tables share similar storage configuration:
Engine: MergeTree
Partition By:
block_date_utc
orblock_date
(daily partitions)Order By: (
slot
,tx_idx
) as primary keyTTL: Data is retained for 1 year
Settings:
index_granularity = 8192
min_bytes_for_wide_part = 10485760
(10MB)
Common Indexes
Most tables implement similar indexing strategies:
Bloom filter indexes on wallet addresses (
signing_wallet
,from_wallet
, etc.)MinMax index on
block_time
for efficient time-range queriesBloom filter indexes on token addresses and pool identifiers
Table Details
PumpSwap All Swaps
The pumpswap_all_swaps
table stores detailed information about PumpSwap transactions on the Solana blockchain.
Swap Direction and Tokens
direction
LowCardinality(String)
Swap direction - "B" for buy or "S" for sell
base_token
String
Solana address of the base token in the swap
quote_token
String
Solana address of the quote token in the swap
Token Amounts
base_token_amount
UInt64
Amount of base tokens involved in the swap
quote_token_amount
UInt64
Amount of quote tokens involved in the swap
quote_token_amount_limit
UInt64
Maximum amount of quote tokens the user is willing to swap
quote_token_amount_without_lp_fee
UInt64
Quote token amount before LP fees are applied
User Account Information
user_base_token_account
String
Solana address of the user's base token account
user_quote_token_account
String
Solana address of the user's quote token account
user_base_token_reserves
UInt64
User's base token balance
user_quote_token_reserves
UInt64
User's quote token balance
Pool State Information
pool_id
String
Pool ID
pool_base_token_reserves_before
UInt64
Pool's base token reserves before the swap
pool_quote_token_reserves_before
UInt64
Pool's quote token reserves before the swap
pool_base_token_reserves_after
UInt64
Pool's base token reserves after the swap
pool_quote_token_reserves_after
UInt64
Pool's quote token reserves after the swap
Fee Information
lp_fee_basis_points
UInt16
LP fee in basis points (1 basis point = 0.01%, 1/10000)
lp_fee
UInt64
LP fee amount in token units
protocol_fee_basis_points
UInt16
Protocol fee in basis points
protocol_fee
UInt64
Protocol fee amount in token units
Important Notes
The
direction
field uses "B" for buys and "S" for sellsIn complex transactions, the signing wallet may differ from the fee payer
Data is extracted through the PumpSwapAnySwapDetector which identifies PumpSwap instructions
Instructions are parsed for both top-level and inner (nested) instructions
PumpFun AMM Migrations
The pfamm_migrations
table stores data about token migrations within the PumpFun AMM protocol.
Column Descriptions
user
String
Base58-encoded address of the user who initiated the migration
mint
String
Base58-encoded address of the token mint being migrated
mint_amount
UInt64
Amount of tokens being migrated (in smallest denomination)
sol_amount
UInt64
Amount of SOL involved in the migration (in lamports)
pool_migration_fee
UInt64
Fee charged by the protocol for the migration (in lamports)
bonding_curve
String
Base58-encoded address of the bonding curve used in the migration
timestamp
UInt32
Unix timestamp of when the migration occurred
pool
String
Base58-encoded address of the destination pool for the migration
Data Population
This table is populated by the PumpFunAmmMigrationDetector which:
Scans Solana transactions for PumpFun program interactions
Identifies migration instructions by their instruction discriminator (
9beae792ec9ea21e
)Looks for corresponding migration log events (
e445a52e51cb9a1d
)Extracts structured data about the migration
Example Queries (PF AMM migrations)
Find migrations by a specific user:
Calculate daily migration volume:
Find most migrated tokens:
Meteora Swaps
The meteora_swaps
table stores detailed information about swap transactions executed on the Meteora LB (Liquidity Book) DEX on Solana.
Column Descriptions
base_coin
String
Solana address of the base token in the trading pair
quote_coin
String
Solana address of the quote token in the trading pair
base_coin_amount
UInt64
Amount of base tokens involved in the swap (raw value)
quote_coin_amount
UInt64
Amount of quote tokens involved in the swap (raw value)
start_bin_id
Int32
ID of the starting liquidity bin used in the swap
end_bin_id
Int32
ID of the ending liquidity bin used in the swap
fee
UInt64
Total swap fee collected (raw value)
protocol_fee
UInt64
Portion of the fee paid to the protocol (raw value)
fee_bps_low
UInt64
Lower bound of the fee rate in basis points
fee_bps_high
UInt64
Upper bound of the fee rate in basis points
host_fee
UInt64
Portion of the fee paid to the host/referrer (raw value)
lb_pair
String
Solana address of the liquidity book pair contract
swap_for_y
UInt8
Boolean flag (0/1) indicating swap direction
Working with Raw Values
Several monetary amounts in this table are stored as raw integer values without decimal conversion. To convert these to actual token amounts, you need to divide by 10^(token decimals). For example, if a token has 9 decimals, divide the raw amount by 10^9.
Example Queries (Meteora swaps)
Daily Swap Volume by Token Pair:
Fee Analysis:
Active Traders Analysis:
Bin Range Analysis:
Underlying Protocol Context
Meteora is a concentrated liquidity DEX on Solana that uses a bin model similar to Uniswap v3, but with some key differences:
Liquidity is organized in discrete bins rather than continuous ranges
The
start_bin_id
andend_bin_id
fields indicate which bins were used in the swapThe
swap_for_y
field indicates the direction of the swap (X→Y or Y→X)
Performance Considerations
When working with these tables, consider the following best practices:
Always filter by
block_date
orblock_date_utc
when possible to leverage partitioningFor time-series analysis over longer periods, use
block_time
with the minmax indexThe tables are optimized for queries filtering by token addresses and wallet addresses
When joining tables, try to join on
signature
as it uniquely identifies transactionsUse appropriate data conversion for raw token amounts based on token decimals
Data Retention
Data in all tables is automatically deleted after 1 year based on the TTL setting.
Last updated