All packages
gantry

gantry

wildanrhmn
v0.1.0/46 downloads/Repository

Package ref

gantry@v0.1.0

Run package

Start block
25900000, the module's first block

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

gantry substreams

Extracts Uniswap v4 swaps and finds sandwiches in them.

map_swaps is deliberately generic, so any v4 pipeline can reuse it. map_sandwiches consumes its output and looks for one address opening and closing a position around somebody else's trade inside a single block and pool.

Authentication

Substreams streams come from The Graph Market.

  1. Create an account and an API key at https://thegraph.market
  2. substreams auth - opens a browser, fetches the key over the API and exchanges it for a JWT, then writes .substreams.env
  3. . ./.substreams.env

substreams auth --paste accepts an existing JWT if the browser flow is awkward. The variable is SUBSTREAMS_API_TOKEN. .substreams.env is gitignored.

Run

substreams gui substreams.yaml map_sandwiches -e mainnet.eth.streamingfast.io:443 \
  --start-block 21000000 --stop-block +1000

Modules

Execution graph

9 modules
store

store_first_block

from #25900000

Store value

int64

Update policy

set_if_not_exists

Inputs

store

store_last_block

from #25900000

Store value

int64

Update policy

set

Inputs

store

store_seen_originators

from #25900000

Store value

int64

Update policy

set_if_not_exists

Inputs