Skip to main content

Overview

  • Dataset ID: 0303
  • Table: blockdb_evm.0303_liquidity_pools_swap_fees
  • Description: Per-swap fee accounting: executed swap sizes plus computed fee amounts using the pool’s fee terms (blockdb_evm.0204_liquidity_pools_fee_terms).
  • Primary Key: id

Columns

ColumnTypeDescription
idBIGINTSurrogate identity for the swap-fee record (auto-incremented).
pool_uidBYTEAPool identifier (internal). Join to pool metadata and fee terms.
block_numberBIGINTBlock height where the swap was observed.
block_timeTIMESTAMPTZUTC timestamp of the block containing the swap event.
tx_indexINTEGERTransaction index within the block.
log_indexINTEGERLog index within the transaction.
token_inBYTEA20-byte address of the input token (direction of swap).
token_outBYTEA20-byte address of the output token (direction of swap).
fee_tokenBYTEA20-byte token address the fee is denominated in (must equal token_in or token_out).
amount_inNUMERIC(78,18)Executed input amount (decimals-adjusted).
amount_outNUMERIC(78,18)Executed output amount (decimals-adjusted).
fee_amount_totalNUMERIC(78,18)Total fee amount in fee_token units (decimals-adjusted).
fee_amount_userNUMERIC(78,18)User/LP share of fees in fee_token units (nullable).
fee_amount_protocolNUMERIC(78,18)Protocol share of fees in fee_token units (nullable).
fee_amount_extraNUMERIC(78,18)Extra destination share of fees in fee_token units (nullable).
_tracing_idBYTEADeterministic BlockDB lineage identifier for the swap-fee record.
_genesis_tracing_idsBYTEA[]Tracing IDs for the raw artifacts (blocks/logs) that seeded this record.
_parent_tracing_idsBYTEA[]Tracing IDs for upstream derived records referenced during computation (e.g., fee terms).
_created_atTIMESTAMPTZRecord creation timestamp.
_updated_atTIMESTAMPTZRecord update timestamp.

Use Cases

  • Pool revenue attribution (LP vs protocol vs extra destinations)
  • Backtesting fee-sensitive execution and routing strategies
  • Inputs to pool yield/ROI modeling (feeds blockdb_evm.0411_liquidity_pools_yields)
  • Monitoring fee regime changes and their downstream impacts