Messages
No examples found{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples found{
"chain_id": 123,
"dataset_id": "<string>",
"is_reorg": true,
"data": {
"pool_uid": "<string>",
"token_in": "<string>",
"token_out": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fee_amount_total": "<string>",
"block_number": 123,
"_tracing_id": "<string>"
}
}Swaps
Swap Fees
Subscribe to real-time per-swap fee accounting for pool economics and yield modeling.
WSS
Overview
- Dataset ID:
0303 - Liquidity Pool Swap Fees - Description: Per-swap fee accounting: executed swap sizes plus computed fee amounts using the pool’s fee terms (
blockdb_evm.b0212_liquidity_pools_fee_terms_v1). - Sample: Hugging Face Sample
Subscription Parameters
Filter updates to specific BlockDB pool identifiers.
Filter by input token addresses (hex strings, 20 bytes, no
0x prefix).Message Fields
BlockDB pool identifier.
Exchange/DEX identifier.
Pool type identifier.
Block height where the swap occurred.
Block time (ISO-8601).
Transaction index.
Log index.
Address of the input token.
Address of the output token.
Token address the fee is denominated in.
Executed input amount (raw units, integer string).
Executed output amount (raw units, integer string).
Total fee amount in
fee_token units.User/LP share of fees (raw units, nullable).
Protocol share of fees (raw units, nullable).
Extra destination share of fees (raw units, nullable).
Row-level lineage hash for correlation.
Parent lineage ids (hex).
Record creation time (ISO-8601).
Record last update time (ISO-8601).
Subscription Example
# Use wscat to connect and subscribe
wscat -c wss://api.blockdb.io/v1/evm/ \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-x '{"action": "subscribe", "dataset_id": "0303", "chain_id": 1, "params": {"token_in_addresses": ["c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"]}}'
Response Example
{
"chain_id": 1,
"dataset_id": "0303",
"is_reorg": false,
"data": {
"pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
"exchange_id": 1,
"type_id": 201,
"block_number": 19000042,
"block_time": "2025-12-20T12:34:56Z",
"tx_index": 15,
"log_index": 88,
"token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"fee_token": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount_in": "5.000000000000000000",
"amount_out": "15850.000000000000000000",
"fee_amount_total": "0.015000000000000000",
"fee_amount_user": "0.012000000000000000",
"fee_amount_protocol": "0.003000000000000000",
"fee_amount_extra": "0.000000000000000000",
"_tracing_id": "0303c0ffee000000000000000000000000000000000000000000000000000001",
"_parent_tracing_ids": [
"0103c0ffee000000000000000000000000000000000000000000000000000001",
"0204c0ffee000000000000000000000000000000000000000000000000000001"
],
"_created_at": "2025-12-20T12:35:01Z",
"_updated_at": "2025-12-20T12:35:01Z"
}
}
Messages
No examples found{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples found{
"chain_id": 123,
"dataset_id": "<string>",
"is_reorg": true,
"data": {
"pool_uid": "<string>",
"token_in": "<string>",
"token_out": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fee_amount_total": "<string>",
"block_number": 123,
"_tracing_id": "<string>"
}
}subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object
Last modified on April 6, 2026
Was this page helpful?
⌘I