toaster-finance/toaster-subgraphs · 文件
文件最后提交记录最后更新时间
README.md
Toaster Subgraphs
Subgraphs for DeFi specific PnL Tracker, powered by Toaster Labs
Add subgraphs
- Add abi(json) files into
abisfolder - 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
How to Deploy Subgraphs
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