Subgraphs for DeFi specific PnL Tracker, powered by Toaster Labs
- Add abi(json) files into
abis
folder - Write subgraph yaml file at
definitions/{protocol}/{protocol}.subgraph.yaml
.- protocol name should be lowercase.
- Run
yarn codegen
- Write protocol configs for each networks at
definitions/{protocol}/{protocol}.{network}.json
.- Find network name on The graph supported networks
- Write subgraph functions at
src/projects/{protocol}/index.js
- Two kinds of functions are needed
- PositionChange tracker
- use eventHandlers
- use savePositionChange at
src/common/savePositionChange.ts
- PositionSnapshot taker
- use blockHandlers
- use savePositionSnapshot at
src/common/savePositionSnapshot.ts
- PositionChange tracker
- Two kinds of functions are needed
yarn deploy -- network={network} protocol={protocol} env={local|prod}
Example Deploying subgraph of SyncSwap on Linea with dev(local) api key
yarn deploy -- network=linea protocol=syncswap env=local
Supported Networks The graph supported networks