Skip to main content
POST
https://api.blockdb.io
/
v1
/
evm
/
prices
/
spot
/
fiat
/
vwap
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/fiat/vwap" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_block": 18930000,
  "to_block": 18939999,
  "exchange_ids": [
    1,
    2
  ],
  "pool_uids": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
  ],
  "limit": 200,
  "cursor": null
}'
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "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",
      "vwap": "3024.112233445566778899",
      "trade_count": 142,
      "volume_base": "580.000000000000000000",
      "volume_quote": "1750000.000000000000000000",
      "start_block": 18930000,
      "end_block": 18939999,
      "start_timestamp": "2025-11-11T18:00:00Z",
      "end_timestamp": "2025-11-11T19:00:00Z",
      "_tracing_id": "0601000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T19:00:05.000Z",
      "_updated_at": "2025-11-11T19:00:05.000Z"
    }
  ],
  "cursor": null,
  "count": 1
}

Description

Returns volume-weighted average prices (VWAP) for ERC-20 base tokens quoted in fiat currencies. This endpoint mirrors the ERC-20 pairing, letting you benchmark execution quality without running a separate FX stack.
Provide quote_currency_code using values from the Fiat Currency enumeration.

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_currency_code
string
required
Fiat currency code for the quote leg.

Range Filters (mutually exclusive)

from_block
number
Starting block number (inclusive) for the query window.
to_block
number
Ending block number (inclusive) for the query window.
from_timestamp
string
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used.
to_timestamp
string
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used.
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.

Direct Selectors

exchange_ids
number[]
Filter by exchange identifiers. See the DigitalExchange enumeration.
pool_uids
string[]
Restrict to specific BlockDB pool identifiers.

Pagination Controls

limit
number
default:"250"
Recommended default 250; maximum 1000 to stay under ~10 MB responses.
cursor
string
Opaque pagination cursor supplied by a previous response.

Response Fields

chain_id
number
EVM chain ID echoed at the response root.
base_token_address
string
ERC-20 contract address of the base asset.
quote_currency_code
string
Fiat currency code for the quote leg.

Meta

meta
object
Echo of request metadata applied to the response.
meta.request_window
object
Block/timestamp bounds derived from the request.
meta.filters
object
Filters applied to the query (exchange IDs, pool UIDs).

Data

data
object[]
VWAP aggregates matching the request.
data.chain_id
number
EVM chain identifier.
data.pool_uid
string
Pool identifier. Present for per-pool results.
data.vwap
string
Volume-weighted average price for the interval (fiat per base unit).
data.trade_count
number
Number of trades contributing to the VWAP.
data.volume_base
string
Aggregate executed volume in base units.
data.volume_quote
string
Aggregate executed volume in fiat units.
data.start_block
number
Starting block number for the window.
data.end_block
number
Ending block number for the window.
data.start_timestamp
string
Inclusive start of the window (ISO-8601).
data.end_timestamp
string
Inclusive end of the window (ISO-8601).
data._tracing_id
string
Tracing identifier for the VWAP 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.
count
number
Number of VWAP entries returned.
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/fiat/vwap" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_block": 18930000,
  "to_block": 18939999,
  "exchange_ids": [
    1,
    2
  ],
  "pool_uids": [
    "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
  ],
  "limit": 200,
  "cursor": null
}'
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "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",
      "vwap": "3024.112233445566778899",
      "trade_count": 142,
      "volume_base": "580.000000000000000000",
      "volume_quote": "1750000.000000000000000000",
      "start_block": 18930000,
      "end_block": 18939999,
      "start_timestamp": "2025-11-11T18:00:00Z",
      "end_timestamp": "2025-11-11T19:00:00Z",
      "_tracing_id": "0601000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T19:00:05.000Z",
      "_updated_at": "2025-11-11T19:00:05.000Z"
    }
  ],
  "cursor": null,
  "count": 1
}