Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.24 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.24 KB

Toaster Subgraphs

Subgraphs for DeFi specific PnL Tracker, powered by Toaster Labs

Add subgraphs

  1. Add abi(json) files into abis folder
  2. Write subgraph yaml file at definitions/{protocol}/{protocol}.subgraph.yaml.
    • protocol name should be lowercase.
  3. Run
    yarn codegen
  4. Write protocol configs for each networks at definitions/{protocol}/{protocol}.{network}.json.
  5. Write subgraph functions at src/projects/{protocol}/index.js
    • Two kinds of functions are needed
      1. PositionChange tracker
        • use eventHandlers
        • use savePositionChange at src/common/savePositionChange.ts
      2. PositionSnapshot taker
        • use blockHandlers
        • use savePositionSnapshot at src/common/savePositionSnapshot.ts

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