Description
The Spot LWAP stream delivers real-time updates to liquidity-weighted average prices for ERC-20 token pairs. LWAP weights prices by available liquidity depth in AMM pools rather than realized volume, providing a more robust mid-price for illiquid assets.
Subscription Parameters
ERC-20 contract address for the base asset.
ERC-20 contract address for the quote asset.
Basis-point radius used for liquidity weighting.
Message Fields
Liquidity-weighted average price for the interval.
Effective liquidity volume considered.
Inclusive start of the window.
Row-level lineage hash for correlation.
Subscription Example
# Use wscat to connect and subscribe
wscat -c wss://stream.blockdb.io/v1/evm/ \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-x '{"action": "subscribe", "dataset_id": "0502", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "depth_offset_bps": 50}}'
Response Example
{
"chain_id": 1,
"dataset_id": "0502",
"is_reorg": false,
"data": {
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"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": "0502000000000000000000000000000000000000",
"_created_at": "2025-11-11T19:00:05.000Z"
}
}