This Subgraph sources events from the Beefy CLM contracts in different networks.
- Git: git-scm.com
- Node.js: nodejs.org, see version in .nvmrc
- Yarn: yarnpkg.com
- Docker: docker.com
- Docker Compose: docker.com
yarn install
yarn infra:strat
yarn remove-local # if you have already deployed the subgraph
yarn create-local # create the subgraph locally
yarn prepare:<network> # apply configuration for the network
yarn codegen # generate the typescript types
yarn build # build the subgraph code
yarn deploy-local # deploy the subgraph locally
yarn test # run all tests
yarn test:graph # run only matchstick-as graph tests
yarn test:lint # run prettier linter
- Add the network configuration config/.json.
clockTickBlocks
is the number of blocks between each clock tick, aim for a clock tick every 5 minutes.- Find the uniswap v3, QuoterV2 contract address on uniswap's documentation
- Find the /USD price feed on chainlink's documentation. Verify that it's a ChainLink
AggregatorV3Interface
with thelatestRoundData()
method.
- Add dev RPCs in graph-node config docker/graph-node/config.toml.
- Add a new
prepare:<network>
script in package.json. - Add a new
deploy:<network>:<provider>
script in package.json.
- Create or update the schema.graphql file.
- See TheGraph docs for defining entities
- Run
yarn codegen
to generate the typescript types.
- See TheGraph docs for TypeScript code generation
- Update subgraph.template.yaml with the new entity bindings and/or data sources if needed.
- TheGraph docs for defining a call handler
- TheGraph docs for defining a block handler
- TheGraph docs for defining a data source template
- Update or create the mappings in the mappings folder to handle the new entity.
- TheGraph docs for defining mappings
- TheGraph AssemblyScript API
- Write tests for the new mappings in the tests folder.
- TheGraph docs for testing mappings
./bin/deploy.sh <network> goldsky
./bin/deploy.sh <network> 0xgraph
# or both
./bin/deploy.sh <network> goldsky 0xgraph
- vaultFactory: ProxyCreated(address)
- vault.balances()
- vault.totalSupply()
- vault.balanceOf()
- vault.strategy()
- vault.wants()
- vault: Initialized(uint8)
- vault: Transfer(indexed address,indexed address,uint256)
- strategyFactory: GlobalPause(bool)
- strategy.pool()
- strategy.vault()
- strategy.output()
- strategy.price()
- strategy.range()
- strategy.balanceOfPool()
- strategy.lpToken1ToNativePrice()
- strategy.lpToken0ToNativePrice()
- strategy.ouptutToNativePrice()
- strategy: Initialized(uint8)
- strategy: Paused(address)
- strategy: Unpaused(address)
- strategy: Harvest(uint256,uint256)
- strategy: ClaimedFees(uint256,uint256,uint256,uint256)
- strategy: ClaimedOutput(uint256)
- rewardPoolFactory: ProxyCreated(address)
- rewardPool.stakedToken()
- rewardPool: Initialized(uint8)