Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

chain_data

Postgres schema written by eth-indexer. Full column notes: eth-indexer/DATA_GUIDE.md.

Every event row FKs to tx via tx_id. Join contract_address to tokens / pools for metadata.

Tables

TableContents
txtx_hash, block_number, date_block (UTC), success
token_transferERC-20 Transfer
token_mint / token_burnmint / burn
faucet_givefaucet payouts
pool_swapSwap / SwapSettlement
pool_depositdeposits (including the deposit half of a swap)
index_activeactivation flips on an index
ownership_changeOwnershipTransferred
tokens / poolsmetadata; removed=true means delisted, row kept

Idempotency: (tx_id, …, log_index).

Values are raw integers. Scale with power(10, token_decimals).

pool_swap.fee, protocol_fee, and all out amounts are in token_out. quoted_out_value / nominal_out_value / protocol_fee are NULL below pool_settlement_block. Treat NULL as unknown, not zero.

Example

SELECT
    tt.contract_address,
    tk.token_symbol,
    COUNT(*) AS transfer_count,
    SUM(tt.transfer_value / power(10, tk.token_decimals)) AS total_volume
FROM token_transfer tt
JOIN tx ON tx.id = tt.tx_id
JOIN tokens tk ON tk.contract_address = tt.contract_address
WHERE tx.success = true AND tk.removed = false
GROUP BY tt.contract_address, tk.token_symbol
ORDER BY total_volume DESC;