
Uniswap v4
Base · PoolManager

Pools & swaps, accessible in minutesDecode PoolManager + PositionManager events with Substreams, land them in ClickHouse, and serve apps with Hasura GraphQL — no business state in WASM.

Base · PoolManager

WASM extract · typed events

events + SQL HOL views

instant GraphQL API
Fixed PoolManager + PositionManager only — no dynamic pool contracts, no stores for Tier A+B.
Address-gated decode of Initialize, Swap, ModifyLiquidity, and Position NFT Transfer logs. Output: typed protobuf events.
substreams sink clickhouse inserts events. SQL views project api_pools, api_swaps, positions, tokens.
Hasura tracks public api_* views over ClickHouse and exposes GraphQL — with Console for exploring pools and swaps live.
Same sg2ss rules as other packages: events in WASM, HOL in the database, GraphQL as a read-only serving layer.
V4 pools are not separate contracts — all pool logs come from one PoolManager. Identity is bytes32 pool id, not a cloned address.
ERC-721 Transfer is generic — only PositionManager is decoded so tables stay clean.
ClickHouse is yours: indexes, partitions, and query plans. Hasura only tracks views you choose. Optional hosted sink from StreamingFast if you do not want to run the sink yourself.
After the sink has data and views are tracked, open pools are one GraphQL request away.
query OpenPools { uniswap_v4_api_pools(limit: 5) { pool_id token0 token1 fee tick liquidity swap_count } }
curl -s http://localhost:8080/v1/graphql \
-H 'content-type: application/json' \
-H 'x-hasura-admin-secret: SecureMe!' \
-d '{"query":"{ uniswap_v4_api_pools(limit: 5) { pool_id token0 token1 fee tick liquidity swap_count } }"}'
Install the Substreams CLI. Package source: uniswap-v4-substreams@v0.1.0. Local stack: Docker Compose for ClickHouse + Hasura.
StreamingFast can host Substreams for you against your ClickHouse or Postgres.
# clone chain-modules, then enter the package git clone https://github.com/streamingfast/substreams-chain-modules.git cd substreams-chain-modules/dex/uniswap-v4-substreams docker compose up -d # install CLI: https://docs.substreams.dev/how-to-guides/installing-the-cli substreams sink clickhouse ./substreams.yaml \ --dsn "clickhouse://default:SecureMe!@127.0.0.1:9000/uniswap_v4" \ -s 25350988 --network base \ --cursor-file-path ./cursor.txt \ --sink-info-folder ./ch-sink-info # after tables exist ./scripts/apply_views.sh ./scripts/hasura_connect_clickhouse.sh
GraphQL · http://localhost:8080/v1/graphql
Console · http://localhost:8080/console · secret SecureMe!
ClickHouse · http://127.0.0.1:8123 · DB uniswap_v4