Output
uniswap.v2.v1.Eventssupeeerpower-uniswap-v2
Package ref
supeeerpower-uniswap-v2@v0.1.0Run package
CLI
Run map_events from the command line.
substreams run supeeerpower-uniswap-v2@v0.1.0 map_events -e mainnetsubstreams auth or directly on thegraph.market (see docs).README
supeeerpower-uniswap-v2
Uniswap V2 Substreams for Ethereum, BNB Chain, and Base: factory PairCreated events and Sync events on those pairs.
Overview
This package indexes Uniswap V2 from each factory's deployment. It decodes factory PairCreated and Sync events on those pairs, including creates and Sync in the same block. Output is typed protobuf for substreams run / GUI.
Pick the chain with --network mainnet, --network bsc, or --network base.
| Network | Factory | initialBlock |
|---|---|---|
mainnet | 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f | 10000835 |
bsc | 0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6 | 36111192 |
base | 0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6 | 6601915 |
Modules
| Name | Kind | Output | Description |
|---|---|---|---|
map_pair_created | map | proto:uniswap.v2.v1.Events | Factory PairCreated events (pair_created). |
store_pairs | store | proto:uniswap.v2.v1.PairCreated | Pair metadata keyed by pool:<address> for Sync filtering. |
map_events | map | proto:uniswap.v2.v1.Events | PairCreated plus Sync on those pairs, including same-block creates. |
Prerequisites
- Substreams CLI
- Rust with
wasm32-unknown-unknown(rustup target add wasm32-unknown-unknown) - A Substreams API key from The Graph Market (
substreams authorSUBSTREAMS_API_KEY)
Quick Start
# Build WASM into ./target (override CARGO_TARGET_DIR if your environment sets it)
CARGO_TARGET_DIR=./target cargo build --target wasm32-unknown-unknown --release
substreams pack
# Ethereum
substreams run substreams.yaml map_events \
--network mainnet \
-s 10000835 \
-t +1000 \
-o jsonl
# Base
substreams run substreams.yaml map_events \
--network base \
-s 6601915 \
-t +1000 \
-o jsonl
# BNB Chain
substreams run substreams.yaml map_events \
--network bsc \
-s 36111192 \
-t +1000 \
-o jsonl
Use map_pair_created to inspect factory creates only. substreams gui substreams.yaml map_events --network mainnet -s 10008355 is useful for browsing decoded events.
First PairCreated is shortly after deployment on each chain: Ethereum around 10008355, Base around 10526493, BNB Chain at 36111192.
Modules
Execution graph
Output
uniswap.v2.v1.EventsInputs
Store value
proto:uniswap.v2.v1.PairCreatedUpdate policy
set
Inputs
Show 2 dependencies
Output
sf.substreams.ethereum.v1.Events
`index_events` sets the following keys on the block: * Event signatures evt_sig:0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef (signature in hex, prefixed by 0x) * Event address evt_addr:0x0123456789abcdef0123456789abcdef01234567 (address in hex, prefixed by 0x)
Output
sf.substreams.index.v1.Keys
Inputs