Skip to main content
POST
https://api.blockdb.io
/
v1
/
evm
/
pools
/
fee-terms
curl -X POST "https://api.blockdb.io/v1/evm/pools/fee-terms" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "from_block": 19000000,
  "to_block": 19010000,
  "pool_addresses": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f564"
  ],
  "limit": 250
}'
{
  "chain_id": 1,
  "meta": {
    "request_window": {
      "from_block": 19000000,
      "to_block": 19010000
    },
    "filters": {
      "pool_addresses": [
        "88e6a0c2ddd26feeb64f039a2c41296fcb3f564"
      ],
      "limit": 250,
      "cursor": null
    }
  },
  "data": [
    {
      "chain_id": 1,
      "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
      "block_number": 19001234,
      "block_time": "2025-12-20T12:34:56Z",
      "tx_index": 7,
      "log_index": 12,
      "total_fee": "0.003000000000000000",
      "user_fee": "0.003000000000000000",
      "protocol_fee": "0.000000000000000000",
      "extra_fee": "0.000000000000000000",
      "_tracing_id": "0204c0ffee000000000000000000000000000000000000000000000000000001",
      "_parent_tracing_ids": [
        "0103c0ffee000000000000000000000000000000000000000000000000000001"
      ],
      "_genesis_tracing_ids": [
        "0103c0ffee000000000000000000000000000000000000000000000000000001"
      ],
      "_created_at": "2025-12-20T12:35:01Z",
      "_updated_at": "2025-12-20T12:35:01Z"
    }
  ],
  "cursor": null,
  "count": 1
}

Description

Retrieves versioned fee terms for liquidity pools, including the total swap fee fraction (e.g., 0.003) and optional split fractions across LP/user, protocol, and extra recipients. Use this endpoint to:
  • Attribute swap fees across recipients
  • Join fee configuration to per-swap fee accounting and pool yield models
  • Detect fee regime changes over time for a pool

Parameters

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

Range Filters (mutually exclusive)

from_block
number
Starting block number (inclusive) for the query. Use with to_block.
to_block
number
Ending block number (inclusive) for the query. Use with from_block.
from_timestamp
string
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used. Use with to_timestamp.
to_timestamp
string
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used. Use with from_timestamp.
Validation rule:
You must provide either a block range, a time range, or at least one direct selector.
Providing more than one option results in HTTP 400.
Providing none results in HTTP 400.

Pool Selectors

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

Pagination Controls

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

Response Fields

chain_id
number
EVM chain ID echoed at the response root.

Meta

meta
object
Echo of request metadata applied to the response.
meta.request_window
object
Normalized block/timestamp bounds derived from the request.
meta.filters
object
Filters echoed from the request (selectors, pagination state, etc.).

Data

data
object[]
Array of pool fee-terms records matching the request.
data.chain_id
number
Chain ID for the fee-terms record.
data.pool_uid
string
BlockDB pool identifier (uid from /evm/pools).
data.block_number
number
Block height where the fee-terms record is anchored.
data.block_time
string
Block timestamp joined from the blocks table for easier aggregation.
data.tx_index
number
Zero-based index of the parent transaction within the block.
data.log_index
number
Position of the log within the transaction.
data.total_fee
string | null
Total fee fraction (e.g., 0.003 = 0.30%). Returned as a string to preserve precision.
data.user_fee
string | null
Absolute fee fraction allocated to LPs/users (same units as total_fee). Returned as a string to preserve precision.
data.protocol_fee
string | null
Absolute fee fraction allocated to protocol/treasury (same units as total_fee). Returned as a string to preserve precision.
data.extra_fee
string | null
Absolute fee fraction allocated to extra destinations (burn, staking, etc.) (same units as total_fee). Returned as a string to preserve precision.
data._tracing_id
string
Row-level lineage hash (hex string, no 0x prefix).
data._parent_tracing_ids
string[]
Lineage references of immediate parents.
data._genesis_tracing_ids
string[]
Lineage references to the original on-chain artifacts that seeded this record.
data._created_at
string
Record creation timestamp (ISO-8601).
data._updated_at
string
Last update timestamp (ISO-8601).

Envelope Fields

cursor
string | null
Cursor token for pagination.
count
number
Number of records returned in data.
curl -X POST "https://api.blockdb.io/v1/evm/pools/fee-terms" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "from_block": 19000000,
  "to_block": 19010000,
  "pool_addresses": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f564"
  ],
  "limit": 250
}'
{
  "chain_id": 1,
  "meta": {
    "request_window": {
      "from_block": 19000000,
      "to_block": 19010000
    },
    "filters": {
      "pool_addresses": [
        "88e6a0c2ddd26feeb64f039a2c41296fcb3f564"
      ],
      "limit": 250,
      "cursor": null
    }
  },
  "data": [
    {
      "chain_id": 1,
      "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
      "block_number": 19001234,
      "block_time": "2025-12-20T12:34:56Z",
      "tx_index": 7,
      "log_index": 12,
      "total_fee": "0.003000000000000000",
      "user_fee": "0.003000000000000000",
      "protocol_fee": "0.000000000000000000",
      "extra_fee": "0.000000000000000000",
      "_tracing_id": "0204c0ffee000000000000000000000000000000000000000000000000000001",
      "_parent_tracing_ids": [
        "0103c0ffee000000000000000000000000000000000000000000000000000001"
      ],
      "_genesis_tracing_ids": [
        "0103c0ffee000000000000000000000000000000000000000000000000000001"
      ],
      "_created_at": "2025-12-20T12:35:01Z",
      "_updated_at": "2025-12-20T12:35:01Z"
    }
  ],
  "cursor": null,
  "count": 1
}