Subgraph for Trader Joe on AVAX chain.
Forked from sushiswap-subgraph
.
subgraph | rinkeby | avalanche |
---|---|---|
exchange | [x] | [x] |
masterchef | [x] | [x] |
bar | [x] | [x] |
# authenticate api key
$ graph auth https://api.thegraph.com/deploy/ <API_KEY>
# build constants
$ cd packages/constants
$ yarn prepare:avax
# build subgraph
$ cd subgraphs/exchange
$ yarn prepare:avax
$ yarn codegen:avax
$ yarn build:avax
# deploy subgraph
$ yarn deploy:avax
Aims to deliver analytics & historical data for Trader Joe. Still a work in progress. Feel free to contribute!
The Graph exposes a GraphQL endpoint to query the events and entities within the SushiSwap ecosytem.
Current subgraph locations:
-
Exchange: Includes all SushiSwap Exchange data with Price Data, Volume, Users, etc: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/exchange
-
Master Chef Joe V2: Indexes all MasterChef v2 staking data: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/masterchefv2
-
Master Chef Joe V3: Indexes all MasterChef v3 staking data: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/masterchefv3
-
Joe Maker: Indexes the JoeMaker contract, that handles the serving of exchange fees to the JoeBar: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/maker
-
Joe Bar: Indexes the SushiBar, includes data related to the bar: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/bar
-
Dexcandles: https://thegraph.com/hosted-service/subgraph/traderjoe-xyz/dexcandles
For any of the subgraphs:
- Run the
yarn run codegen:[subgraph]
command to prepare the TypeScript sources for the GraphQL (generated/schema) and the ABIs (generated/[ABI]/*) - [Optional] run the
yarn run build:[subgraph]
command to build the subgraph. Can be used to check compile errors before deploying. - Run
graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>
- Deploy via
yarn run deploy:[subgraph]
.
- Install docker on local machine https://docs.docker.com/get-docker/)
- Run
yarn start:node
- Build constants:
cd packages/constants && yarn prepare:fuji
- Build subgraph:
cd subgraphs/exchange && yarn prepare:fuji && yarn codegen:fuji && yarn build:fuji
- Create local subgraph:
cd subgraphs/exchange && yarn create-local && yarn deploy-local
- Subgraph endpoint available at http://localhost:8000/subgraphs/name/traderjoe-xyz/exchange-fuji