Description
Computes liquidity-weighted average prices (LWAP) for ERC-20 base tokens quoted in fiat. The backend converts depth-powered analytics into the requested fiat currency so you can benchmark execution quality against fiat order flow.
Use this endpoint whenever you need normalized fiat outputs. The request body mirrors the ERC-20 version except quote_currency_code replaces quote_token_address.
Parameters
Target EVM chain. See the Chain enumeration for supported values.
ERC-20 contract address for the base asset (hex string, 20 bytes, no 0x prefix).
Range Filters (mutually exclusive)
Starting block number (inclusive) for the query window.
Ending block number (inclusive) for the query window.
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used.
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
Restrict to specific BlockDB pool identifiers.
Window Controls
Basis-point radius used when weighting liquidity. Default is 100.
Recommended default 250; maximum 1000 to stay under ~10 MB responses.
Opaque pagination cursor supplied by a previous response.
Response Fields
EVM chain ID echoed at the response root.
ERC-20 contract address of the base asset.
Fiat currency code for the quote leg.
Echo of request metadata applied to the response.
Block/timestamp bounds applied to the query.
Filter parameters (exchange IDs, pool UIDs) echoed from the request.
Data
LWAP aggregates returned for the request.
BlockDB pool identifier provided when per-pool results are available.
Liquidity-weighted average price over the window (fiat per base unit).
Basis-point radius used during weighting.
Effective liquidity volume considered in the calculation.
Inclusive start of the window (ISO-8601).
Inclusive end of the window (ISO-8601).
Tracing identifier for the LWAP row.
Parent lineage references.
data._genesis_tracing_ids
Lineage references to original on-chain events.
Record creation timestamp.
Envelope Fields
Number of LWAP entries returned.
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/fiat/lwap" \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_currency_code": "USD",
"from_timestamp": "2025-11-11T18:00:00Z",
"to_timestamp": "2025-11-11T19:00:00Z",
"exchange_ids": [
1
],
"pool_uids": [
"88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
],
"depth_offset_bps": 50,
"limit": 200,
"cursor": null
}'
{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_currency_code": "USD",
"meta": {
"request_window": {
"from_block": null,
"to_block": null,
"from_timestamp": "2025-11-11T18:00:00Z",
"to_timestamp": "2025-11-11T19:00:00Z"
},
"filters": {
"exchange_ids": [
1
],
"pool_uids": [
"88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000"
]
}
},
"data": [
{
"chain_id": 1,
"pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
"lwap": "3022.445566778899001122",
"depth_offset_bps": 50,
"liquidity_volume": "320.000000000000000000",
"start_timestamp": "2025-11-11T18:00:00Z",
"end_timestamp": "2025-11-11T18:59:59Z",
"_tracing_id": "0602000000000000000000000000000000000000",
"_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
}