Subgraphs for indexing Nexus Protocol smart contracts using The Graph. Useful for querying on-chain data with GraphQL.
- Subgraphs index blockchain data so you can query it via GraphQL.
- Edit the config file with contract addresses + start blocks.
- Authenticate with your deploy key from The Graph Studio.
- Deploy using the scripts in
package.json
.
yarn install
Find the file for your target network under /config. Example: /config/sepolia-v3.json
Fill it out with the correct data:
{
"network": "sepolia",
"AaveOracleAddress": "0xB7c437D99bD1EEd8E8D0eC4fE865b70EfBFAc1f3",
"AaveOracleStartBlock": 8320405,
"PoolAddressesProviderRegistryAddress": "0xdBDa92ca3C9B618dE766c3E68Ff8e12a54347bcD",
"PoolAddressesProviderRegistryStartBlock": 8320373,
"RewardsControllerAddress": "",
"RewardsControllerStartBlock": 8320373
}
Get your deploy key from The Graph Studio and run:
npx graph auth <your-deploy-key>
You can now deploy using the available scripts:
Examples:
# Deploy V2 on Sepolia
yarn subgraph:deploy:sepolia
# Deploy V3 on Sepolia
yarn deploy:sepolia:v3
Manual deployment example:
VERSION=v3 BLOCKCHAIN=v3 NETWORK=mainnet env-cmd npm run prepare:subgraph && SLUG=nexus-mm-mainnet env-cmd npm run subgraph:deploy
During deployment, you'll be asked to enter a version name. If you're unsure what to enter, just check existing versions in Studio and follow the naming pattern.