Skip to main content
POST
https://api.blockdb.io
/
v1
/
evm
/
prices
/
spot
/
crypto
/
depth
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/crypto/depth" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "from_block": 18930000,
  "to_block": 18939999,
  "exchange_ids": [
    1,
    2
  ],
  "pool_uids": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
  ],
  "depth_offset_bps": 100,
  "cursor": null
}'
{
  "chain_id": 1,
  "metric": "depth",
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "depth_offset_bps": 100,
  "meta": {
    "request_window": {
      "from_block": 18930000,
      "to_block": 18939999,
      "from_timestamp": null,
      "to_timestamp": null
    },
    "filters": {
      "exchange_ids": [
        1,
        2
      ],
      "pool_uids": [
        "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
      ]
    }
  },
  "data": [
    {
      "chain_id": 1,
      "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
      "current_price": "3025.219821481234567890",
      "size_in": "150.000000000000000000",
      "size_out": "454000.000000000000000000",
      "target_price": "3055.472019762345678901",
      "block_number": 18935678,
      "block_time": "2025-11-11T18:42:15.123Z",
      "tx_index": 4,
      "log_index": 2,
      "_tracing_id": "0401000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T18:42:15.123Z",
      "_updated_at": "2025-11-11T18:42:15.123Z"
    }
  ],
  "cursor": null,
  "count": 1
}

Description

Returns executable depth snapshots for ERC-20 base and quote token pairs. Depth captures Level 1 liquidity at specific basis-point offsets from the mid price.
For fiat quotes (e.g., USD, EUR), use the dedicated endpoints: /evm/prices/spot/fiat/depth, /vwap, /lwap, and /ohlc.

Parameters

chain_id
number
required
Target EVM chain. See the Chain enumeration for supported values.
base_token_address
string
required
ERC-20 contract address for the base asset (hex string, 20 bytes, no 0x prefix).
quote_token_address
string
required
ERC-20 contract address for the quote asset (hex string, 20 bytes, no 0x prefix).

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 by exchange identifiers. See the DigitalExchange enumeration.
pool_uids
string[]
Restrict to specific BlockDB pool identifiers.

Depth Controls

depth_offset_bps
number
default:"100"
Basis-point offset from mid price. Defaults to 100.

Pagination Controls

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

Response Fields

chain_id
number
EVM chain ID echoed at the response root.
metric
string
Always depth for this endpoint.
base_token_address
string
ERC-20 contract address of the base asset.
quote_token_address
string
ERC-20 contract address of the quote asset.
depth_offset_bps
number
Basis-point distance from mid for quoted depth results.

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
Filter parameters echoed from the request.

Data

data
object[]
Depth snapshots returned for the requested range.
data.chain_id
number
EVM chain identifier.
data.pool_uid
string
BlockDB pool identifier. Absent when an aggregated view is requested.
data.current_price
string
Mid price expressed in quote units per base unit.
data.size_in
string
Executable size of the base asset to reach offset_bps.
data.size_out
string
Executable size of the quote asset to reach offset_bps.
data.target_price
string
Post-trade mid price at the requested offset.
data.block_number
number
Block height of the snapshot.
data.block_time
string
Timestamp of the snapshot block.
data.tx_index
number
Transaction index within the block.
data.log_index
number
Log index within the transaction.
data._tracing_id
string
Tracing identifier for the snapshot row.
data._parent_tracing_ids
string[]
Parent lineage references.
data._genesis_tracing_ids
string[]
Lineage references to original on-chain events.
data._created_at
string
Record creation timestamp.
data._updated_at
string
Record update timestamp.

Envelope Fields

cursor
string | null
Pagination cursor (present when additional snapshots are available).
count
number
Number of snapshots in data.

Usage Notes

  • Omit pool_uids to receive depth for all pools matching the token pair and optional exchange filter.
  • Use block or timestamp bounds (not both) to constrain the window for depth snapshots.
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/crypto/depth" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "from_block": 18930000,
  "to_block": 18939999,
  "exchange_ids": [
    1,
    2
  ],
  "pool_uids": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
  ],
  "depth_offset_bps": 100,
  "cursor": null
}'
{
  "chain_id": 1,
  "metric": "depth",
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "depth_offset_bps": 100,
  "meta": {
    "request_window": {
      "from_block": 18930000,
      "to_block": 18939999,
      "from_timestamp": null,
      "to_timestamp": null
    },
    "filters": {
      "exchange_ids": [
        1,
        2
      ],
      "pool_uids": [
        "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
      ]
    }
  },
  "data": [
    {
      "chain_id": 1,
      "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
      "current_price": "3025.219821481234567890",
      "size_in": "150.000000000000000000",
      "size_out": "454000.000000000000000000",
      "target_price": "3055.472019762345678901",
      "block_number": 18935678,
      "block_time": "2025-11-11T18:42:15.123Z",
      "tx_index": 4,
      "log_index": 2,
      "_tracing_id": "0401000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T18:42:15.123Z",
      "_updated_at": "2025-11-11T18:42:15.123Z"
    }
  ],
  "cursor": null,
  "count": 1
}