TheGraph exposes a GraphQL endpoint to query the events and entities within the Core Chain and ShadowSwap ecosystem.
Currently, there are multiple subgraphs, but additional subgraphs can be added to this repository, following the current architecture.
-
Blocks: Tracks all blocks on Core Chain.
-
Exchange: Tracks all ShadowSwap Exchange data with price, volume, liquidity, ...
-
Pairs: Tracks all ShadowSwap Pairs and Tokens.
-
Shadow Puppet: Tracks all Shadow Puppet metrics with Owners, Tokens (including metadata), and Transactions.
-
SmartChef: Tracks all ShadowSwap SmartChef (a.k.a. Syrup Pools) with tokens and rewards.
-
Timelock: Tracks all ShadowSwap Timelock queued, executed, and cancelled transactions.
-
ShadowChef (v2): Tracks data for ShadowChefV2.
- Graph CLI
- Required to generate and build local GraphQL dependencies.
yarn global add @graphprotocol/graph-cli
For any of the subgraph: blocks
as [subgraph]
-
Run the
cd subgraphs/[subgraph]
command to move to the subgraph directory. -
Run the
yarn codegen
command to prepare the TypeScript sources for the GraphQL (generated/*). -
Run the
yarn build
command to build the subgraph, and check compilation errors before deploying. -
Run
graph auth --product hosted-service '<ACCESS_TOKEN>'
-
Deploy via
yarn deploy
.