One method. Any chain, any table.
Try Bloklake's query API: filter logs on any chain by any filter to pull Uniswap trades, Polymarket order fills, and more.
Filter the logs table by the Swap event topic0. No need to know a specific pool address up front.
uniswap_swaps.py
from bloklake import Client
client = Client(api_key="BLOKLAKE_API_KEY")
# Every Uniswap V3 swap on Ethereum in this block range
swaps = client.query(
chain="ethereum",
table="logs",
block_range=(19_000_000, 19_050_000),
filters={
# Swap(address,address,int256,int256,uint160,uint128,int24)
"topic0": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67",
},
columns=["block_number", "tx_hash", "log_index", "address", "topics", "data"],
)
Same shape, different chain: Polymarket settles on Polygon through its CTF Exchange contract.
polymarket_fills.py
from bloklake import Client
client = Client(api_key="BLOKLAKE_API_KEY")
# Every Polymarket CTF Exchange order fill on Polygon
fills = client.query(
chain="polygon",
table="logs",
block_range=(60_000_000, 60_100_000),
filters={
"address": "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E", # CTF Exchange
# OrderFilled(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)
"topic0": "0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6",
},
columns=["block_number", "tx_hash", "log_index", "topics", "data"],
)
No filters, just a table, a chain, and a range. Useful for gas and throughput analysis.
base_blocks.py
from bloklake import Client
client = Client(api_key="BLOKLAKE_API_KEY")
# Base block headers, last ~1M blocks
blocks = client.query(
chain="base",
table="blocks",
block_range=(10_000_000, 11_000_000),
columns=["number", "timestamp", "gas_used", "base_fee_per_gas"],
)
Custom plans can skip the client and query the tables directly in SQL.
swaps_per_hour.sql
-- Available on the Custom plan
SELECT
date_trunc('hour', block_timestamp) AS hour,
count(*) AS swaps
FROM ethereum.logs
WHERE topic0 = '0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67'
AND block_number BETWEEN 19000000 AND 19050000
GROUP BY 1
ORDER BY 1;
Query parameters
| Parameter | Type | Notes |
|---|---|---|
| chain | str | ethereum, robinhood, base, polygon, … |
| table | str | blocks, transactions, logs, receipts |
| block_range | tuple | (start, end), inclusive |
| filters | dict | e.g. { "address": …, "topic0": … } |
| columns | list | only the columns you need back |
Common topic0 filters
The most common event signatures for filtering the logs table. Copy one straight into filters.topic0.
Uniswap V2 SwapSwap(address,uint256,uint256,uint256,uint256,address)0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822
Uniswap V3 SwapSwap(address,address,int256,int256,uint160,uint128,int24)0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67
Polymarket OrderFilledOrderFilled(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6
Ready to run this against live data?
Join the waitlist for API access: $0.50/GB scanned, 2 RPS included.
Join the waitlist