license: cc-by-nc-4.0
tags:
- ethereum
- evm
- blockchain
- cryptocurrency
- crypto
- onchain-data
- tabular
- timeseries
- datasets
- pandas
- polars
- duckdb
pretty_name: BlockDB Swap Fees - Sample
size_categories:
- 10M<n<100M
Sample Notice
This dataset contains a small sample of the full BlockDB Swap Fees dataset.
It is provided for evaluation, research, and interoperability testing only.
If you need full historical coverage, real-time streaming, or end-of-day (EOD) exports please contact us directly:
π§ support@blockdb.io
π https://www.blockdb.io
Dataset Overview
Per-swap fee accounting with detailed breakdown. Each row represents fee amounts collected on a specific swap event, including total fee, user/LP share, protocol share, and extra fees (burn/staking), all denominated in the fee token (typically token_in).
Chains and Coverage
ETH, BSC, Base, Arbitrum, Unichain, Avalanche, Polygon, Celo, Linea, Optimism (others on request). Full history from chain genesis; reorg-aware real-time ingestion and updates.
Schema
List of columns exactly as delivered:
β’ id BIGINT β Unique swap fee record identifier (primary key)
β’ pool_uid BYTEA β Unique pool identifier (FK to liquidity_pools)
β’ exchange_id INTEGER β Exchange/DEX identifier
β’ type_id INTEGER β Pool type identifier (FK to liquidity_pool_types)
β’ block_number BIGINT β Block when the swap was observed
β’ block_time TIMESTAMPTZ β UTC timestamp when the block was mined
β’ tx_index INTEGER β Transaction index within the block
β’ log_index INTEGER β Log index within the block
β’ token_in BYTEA β 20-byte address of input token
β’ token_out BYTEA β 20-byte address of output token
β’ fee_token BYTEA β 20-byte address of the token fees are denominated in
β’ amount_in NUMERIC(78,0) β Executed input amount (decimals-adjusted)
β’ amount_out NUMERIC(78,0) β Executed output amount (decimals-adjusted)
β’ fee_amount_total NUMERIC(78,0) β Total fee amount in fee_token units
β’ fee_amount_user NUMERIC(78,0) β LP/user share in fee_token units
β’ fee_amount_protocol NUMERIC(78,0) β Protocol share in fee_token units
β’ fee_amount_extra NUMERIC(78,0) β Other share in fee_token units (burn/staking/etc.)
β’ _tracing_id BYTEA β Tracing ID of this swap fees record
β’ _genesis_tracing_ids BYTEA[] β Tracing IDs of the genesis records leading to this record
β’ _parent_tracing_ids BYTEA[] β Tracing IDs of the parent records leading to this record
β’ _created_at TIMESTAMPTZ β Record creation timestamp
β’ _updated_at TIMESTAMPTZ β Record last update timestamp
Notes
β’ fee_token is either token_in or token_out; fee_amount_total β€ amount of fee_token.
β’ fee_amount_user + fee_amount_protocol + fee_amount_extra β€ fee_amount_total.
β’ Unique constraint: (pool_uid, token_in, token_out, block_number, tx_index, log_index) guarantees one fee record per swap log per direction.
β’ Indexes on (pool_uid, block_number DESC, tx_index DESC, log_index DESC), (pool_uid, block_time DESC, tx_index DESC, log_index DESC), (block_number, tx_index, log_index), block_time, and (token_in, token_out, block_time DESC) support fast lookups.
Lineage
Each swap fee record includes deterministic _tracing_id, _genesis_tracing_ids, and _parent_tracing_ids, providing:
β’ Provenance tracking from raw logs to decoded fee events
β’ Reproducible analytics and signal extraction
β’ Cross-system consistency checks (RPC vs. indexers vs. internal warehouses)
Common Use Cases
β’ LP revenue analysis and yield estimation
β’ Protocol fee revenue tracking
β’ Cost of execution analysis for traders
β’ Fee tier comparison across DEXes and pools
Quality
β’ Verifiable lineage: deterministic cryptographic hashes per row
β’ Reorg-aware ingestion: continuity and consistency across forks
β’ Complete historical coverage: from chain genesis to present