Skip to content

balancer/balancer-subgraph-v3

Repository files navigation

Balancer v3 Subgraphs

This repository contains the subgraph implementations for Balancer v3, including pools and vault subgraphs. It's structured as a monorepo using pnpm workspaces.

Preliminary Deployments

Subgraph Version Endpoint
Vault 8th https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-8th/version/latest
Pools 8th https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-8th/version/latest
Vault 7th https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-7th/version/latest
Pools 7th https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-7th/version/latest

Prerequisites

  • Node.js (v18 or later)
  • pnpm (v7 or later)

Setup

  1. Install dependencies:

    pnpm install
    
  2. Generate manifests:

    pnpm generate-manifests
    

    Note: Subgraph manifests (subgraph.yaml) define the smart contracts to index and how to map event data to entities.

  3. Generate types for all subgraphs:

    pnpm codegen
    

    Note: Codegen creates AssemblyScript classes for each smart contract ABI in subgraph.yaml.

Development

Working on a Specific Subgraph

To run commands for a specific subgraph:

pnpm pools <command>  # For pools subgraph
pnpm vault <command>  # For vault subgraph

For example, to build the pools subgraph:

pnpm pools build

Extending the Subgraphs

As Balancer expands to new networks or introduces new pool types, you may need to extend the subgraphs. We've provided detailed documentation to guide you through these processes:

  • Adding Support for New Pool Types If you're building your own pools on Balancer and want to integrate them with the subgraph, this provides a step-by-step guide on how to extend the subgraph to support your new pool type. This ensures that your pool is integrated with Balancer's infraestructure.
  • Adding Support for New Networks This guide walks you through the process of adding a new network to the subgraph. It covers updating the networks.json file, modifying the GitHub Actions workflow, and generating the necessary manifests.

Deployment

Deployment is handled automatically by GitHub Actions when pushing to the main branch. The workflow will:

  1. Generate manifests for all subgraphs
  2. Generate code for all subgraphs
  3. Build and deploy each subgraph to The Graph's hosted service

To deploy manually, ensure you have the necessary credentials and run:

pnpm pools build
pnpm pools deploy

pnpm vault build
pnpm vault deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published