Output
sf.substreams.sink.database.v1.DatabaseChanges

Package ref
streamingfast/velodrome-substreams@v0.2.0Run package
This module reads a store, which starts empty at the module's first block: it runs from there, so its output is from then, not from the chain head. Any later block would first need the store rebuilt up to it.
README
Substreams package for Velodrome V2 on Optimism. Indexes pool creation, swaps, and liquidity events, outputting DatabaseChanges for SQL sink consumption.
| Contract | Address | Init Block |
|---|---|---|
| PoolFactory | 0xF1046053aa5682b4F9a81b5481394DA16BE5FF5a | 119142390 |
sf.ethereum.type.v2.Block
│
▼
map_factory_events ← PoolCreated events from PoolFactory
│
▼
store_pools ← set_if_not_exists; keys = pool addresses
│ (get mode)
▼
map_pool_events ← Swap / Mint / Burn filtered to known pools
│
▼
db_out ← DatabaseChanges for SQL sink
| Table | Primary Key | Description |
|---|---|---|
pools | address | Pool creation events (token0, token1, stable flag) |
swaps | {tx_hash}-{log_index} | Swap events with amounts in/out |
liquidity_events | {tx_hash}-{log_index} | Mint and burn events |
See schema.sql for full column definitions.
# Run against Optimism
substreams run velodrome-substreams-v0.1.0.spkg map_factory_events \
-e optimism.streamingfast.io:443 \
-s 119142390 -t +200 -o jsonl
# Pipe to PostgreSQL sink
substreams-sink-postgres run \
"host=localhost user=dev password=dev dbname=velodrome" \
velodrome-substreams-v0.1.0.spkg db_out
substreams build
substreams pack substreams.yaml
Apache 2.0
Modules
Output
sf.substreams.sink.database.v1.DatabaseChanges
Output
velodrome.types.v1.PoolsStore value
string
Update policy
set_if_not_exists
Inputs