Package Logo
velodrome-substreams
velodrome-substreams@v0.1.0
Total Downloads
4
Published
2 hours ago
Network
optimism optimism
Publisher
StreamingFast

Readme

velodrome-substreams

Substreams package for Velodrome V2 on Optimism. Indexes pool creation, swaps, and liquidity events, outputting DatabaseChanges for SQL sink consumption.

Contracts

Contract Address Init Block
PoolFactory 0xF1046053aa5682b4F9a81b5481394DA16BE5FF5a 119142390

Module Graph

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

Output Tables

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.

Usage

# 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

Build

substreams build
substreams pack substreams.yaml

License

Apache 2.0

Documentation

Modules

Maps icon
Maps

map
map_factory_events

d02c5912f095945d7de004108dc223ded6ff8dff
map map_factory_events (
blocksf.ethereum.type.v2.Block
)  -> velodrome.types.v1.Pools
substreams gui velodrome-substreams@v0.1.0 map_factory_events

map
map_pool_events

ab696b12b8f268e00e08942f02661fcf1e39d882
map map_pool_events (
store_poolsGET<set_if_not_exists,string>
)  -> velodrome.types.v1.Events
substreams gui velodrome-substreams@v0.1.0 map_pool_events

map
db_out

e124f7617ad8f01106df8e737a22d97e365b4f30
substreams gui velodrome-substreams@v0.1.0 db_out
Stores icon
Stores

store
store_pools

479c59d5692ec826a2b2d2d46ee4a70dd50dd5d1
store <set_if_not_exists,string> store_pools (
)
substreams gui velodrome-substreams@v0.1.0 store_pools
Protobuf

Protobuf Docs Explorer

velodrome.types.v1