All packages

velodrome-substreams

maoueh
v0.2.0/0 downloads/Repository

Package ref

velodrome-substreams@v0.2.0

Run package

CLI

Run db_out from the command line.

substreams run velodrome-substreams@v0.2.0 db_out -e optimism
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

velodrome-substreams

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

Contracts

ContractAddressInit Block
PoolFactory0xF1046053aa5682b4F9a81b5481394DA16BE5FF5a119142390

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

TablePrimary KeyDescription
poolsaddressPool 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

Modules

Execution graph

4 modules
store

store_pools

from #119142390

Store value

string

Update policy

set_if_not_exists