Skip to main content

Description

This overview covers spot pricing endpoints where ERC-20 base tokens are quoted in fiat currencies. Outputs are normalized into the requested fiat (e.g., USD, EUR) and derived from verified on-chain trades.

Endpoint Matrix

EndpointSummaryDataset IDTypical Latency
POST /evm/prices/spot/erc20-fiat/ohlcOHLC candlestick bars with volume aggregation0404< 200 ms
POST /evm/prices/spot/erc20-fiat/vwapVolume-weighted average prices over custom windows0501< 200 ms
POST /evm/prices/spot/erc20-fiat/lwapLiquidity-weighted average prices across depth bands0502< 200 ms

Parameter Conventions

chain_id
number
required
Target EVM chain. See the Chain enumeration for supported values.
base_token_address
string
required
Base ERC-20 contract address (hex string, 20 bytes, no 0x prefix).
quote_currency_code
string
required
Fiat currency code. See the Fiat Currency enumeration.

Range Filters (mutually exclusive)

from_block
number
Starting block number (inclusive). Use with to_block.
to_block
number
Ending block number (inclusive). 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: provide either a block range or a time range. Supplying both returns HTTP 400. Supplying neither returns HTTP 400.

Direct Selectors

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

Metric Controls (per endpoint)

  • OHLC: aggregation_interval (required), aggregation_timezone (default UTC).
  • VWAP/LWAP: optional aggregation_interval (defaults server-side).

Pagination

All fiat pricing endpoints support pagination via limit (recommended default 250, max 1000) and cursor. See Pagination & Limits.

Usage Guidance

  • Choose aggregation carefully — Short intervals (1m, 5m) for intraday views; longer (1d) for rollups.
  • Filter by exchange — Compare venue pricing or constrain to known liquidity venues with exchange_ids.

Common Patterns

Get OHLC bars for ERC-20 → fiat:
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_timestamp": "2025-01-01T00:00:00Z",
  "to_timestamp": "2025-01-31T23:59:59Z",
  "aggregation_interval": "1d",
  "aggregation_timezone": "UTC",
  "limit": 250,
  "cursor": null
}
Compute VWAP for ERC-20 → fiat:
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_block": 18930000,
  "to_block": 18939999,
  "exchange_ids": [1, 2],
  "limit": 250,
  "cursor": null
}

See Also