Skip to main content
POST

Overview

  • Dataset ID: 0303 - Liquidity Pool Swap Fees
  • Description: Per-swap fee accounting: executed swap sizes plus computed fee amounts using the pool’s fee terms (blockdb_evm.b0212_liquidity_pools_fee_terms_v1).
  • CSV Sample: Download
  • JSON Sample: Download

Parameters

number
required
Target EVM network. See the Chain enumeration for supported values.

Range Filters (mutually exclusive)

number
Starting block number (inclusive) for the query. Use with to_block.
number
Ending block number (inclusive) for the query. Use with from_block.
string
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used. Use with to_timestamp.
string
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used. Use with from_timestamp.
Scoping rule: Provide exactly one of:
  1. Block range — from_block and to_block
  2. Time range — from_timestamp and to_timestamp
  3. Direct selectors — presented below
Direct selectors may be used on their own, without a block or time range. Do not combine scoping modes. Omitting all three returns HTTP 400.

Pool Selectors

number[]
Filter swaps by exchange IDs. See the DigitalExchange enumeration for supported values.
string[]
Filter by BlockDB pool identifiers (uid from /evm/entities/pools).
string[]
Filter by pool contract addresses (hex string, 20 bytes, no 0x prefix).
string[]
Filter by protocol-specific pool identifiers (e.g., Uniswap V4 pool_id).
number[]
Filter by AMM archetype. See the PoolType enumeration for supported values.

Token Selectors (directional)

string[]
Restrict to swaps where the input token is in this set (hex string, 20 bytes, no 0x prefix).
string[]
Restrict to swaps where the output token is in this set (hex string, 20 bytes, no 0x prefix).
string[]
Restrict to swaps where the fee is denominated in one of these tokens (hex string, 20 bytes, no 0x prefix).

Pagination Controls

number
default:"250"
Recommended default 250; maximum 1000 to stay under ~10 MB responses.
string
Pagination cursor from a prior call.

Decimals-Adjusted Amounts

boolean
default:"false"
Off by default. When set to true, the response includes decimals-adjusted siblings of every *_raw field (amount_in, amount_out, fee_amount_total, fee_amount_user, fee_amount_protocol, fee_amount_extra). Enabling it adds a per-request ERC-20 decimals lookup (extra join) that increases latency, so it is opt-in; when omitted or false, those fields are returned as null and only the always-present *_raw fields are populated.

Response Fields

Meta

object
Echo of request metadata applied to the response.
number
EVM chain ID echoed from the request.
object
Pure echo of the window you sent (from_block/to_block/from_timestamp/to_timestamp); unset bounds are null.
object | null
The concrete window the query actually executed against, after resolving the request. For a block range on a time-bucketed endpoint (OHLC/VWAP/VWAP-aggregate/fiat VWAP), from_timestamp/to_timestamp hold the resolved timestamp window (and from_block/to_block echo your request). For a time range on a block-keyed endpoint, from_block/to_block hold the resolved block range (and the timestamps echo your request). null for selector-only requests (no window). No extra database work is done — these are the values the query already computed.
number | null
Resolved/echoed start block of the executed window.
number | null
Resolved/echoed end block of the executed window.
string | null
Resolved/echoed start timestamp (ISO-8601) of the executed window.
string | null
Resolved/echoed end timestamp (ISO-8601) of the executed window.
object
Filters echoed from the request (selectors, pagination state, etc.).

Data

object[]
Array of per-swap fee records matching the request. There is no separate numeric id field.
string
BlockDB pool identifier (uid from /evm/entities/pools).
number
Exchange/DEX identifier.
number
Pool type identifier.
string
20-byte address of the input token (direction of trade).
string
20-byte address of the output token for this swap direction.
string
Token address the fee is denominated in (typically token_in).
string
Executed input amount as a raw integer in token_in’s smallest denomination. String-encoded to preserve uint256 precision.
string | null
Decimals-adjusted form of amount_in_raw (amount_in_raw / 10^decimals resolved against token_in). null when decimals are unknown or include_adjusted_amounts=false.
string
Executed output amount as a raw integer in token_out’s smallest denomination.
string | null
Decimals-adjusted form of amount_out_raw (resolved against token_out). null when decimals are unknown or include_adjusted_amounts=false.
string
Total fee amount as a raw integer in fee_token’s smallest denomination.
string | null
Decimals-adjusted form of fee_amount_total_raw (resolved against fee_token). null when decimals are unknown or include_adjusted_amounts=false.
string | null
User/LP share of the fee as a raw integer in fee_token units. null when the protocol does not split.
string | null
Decimals-adjusted form of fee_amount_user_raw. null when the raw value is null, when decimals are unknown, or when include_adjusted_amounts=false.
string | null
Protocol share of the fee as a raw integer in fee_token units. null when the protocol does not split.
string | null
Decimals-adjusted form of fee_amount_protocol_raw. Same null semantics as the user field.
string | null
Extra-destination share of the fee as a raw integer in fee_token units. null when not applicable.
string | null
Decimals-adjusted form of fee_amount_extra_raw. Same null semantics as the user field.
number
Block height where the swap event was observed.
string
UTC timestamp of the block containing the swap.
number
Zero-based transaction index within the block.
number
Zero-based log index within the transaction.
string
Row-level lineage hash (hex string, no 0x prefix).
string[]
Lineage references of immediate parents.
string
Record creation timestamp (ISO-8601).
string
Last update timestamp (ISO-8601).

Envelope Fields

string | null
Cursor token for pagination.
number
Number of records returned in data.
Last modified on July 19, 2026