From 4a823dda74362ba0c43ef76f61d296ed08277467 Mon Sep 17 00:00:00 2001 From: mendesfabio Date: Thu, 5 Dec 2024 22:20:25 -0300 Subject: [PATCH] deploy pools subgraph --- .github/workflows/graph-pools.yml | 97 +++++++++++++++++++ .github/workflows/graph-vault.yml | 2 +- .../{template.yaml => subgraph.gnosis.yaml} | 12 +-- subgraphs/v3-pools/subgraph.sepolia.yaml | 50 ++++++++++ subgraphs/v3-pools/subgraph.yaml | 50 ++++++++++ 5 files changed, 204 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/graph-pools.yml rename subgraphs/v3-pools/{template.yaml => subgraph.gnosis.yaml} (81%) create mode 100644 subgraphs/v3-pools/subgraph.sepolia.yaml create mode 100644 subgraphs/v3-pools/subgraph.yaml diff --git a/.github/workflows/graph-pools.yml b/.github/workflows/graph-pools.yml new file mode 100644 index 0000000..83474eb --- /dev/null +++ b/.github/workflows/graph-pools.yml @@ -0,0 +1,97 @@ +name: Deploy Pools Subgraphs +on: + push: + branches: main + +jobs: + deploy-mainnet: + runs-on: ubuntu-latest + environment: graph + steps: + - uses: actions/checkout@v3 + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Install dependencies + run: pnpm install + - name: Graph Codegen + working-directory: subgraphs/v3-pools + run: pnpm codegen subgraph.yaml + - name: Graph Build + working-directory: subgraphs/v3-pools + run: pnpm build subgraph.yaml + - name: Graph Deploy + working-directory: subgraphs/v3-pools + run: > + pnpm graph deploy + --deploy-key ${{secrets.GRAPH_DEPLOY_KEY}} + balancer-pools-v3 + subgraph.yaml + --version-label ${GITHUB_SHA::8} + + deploy-gnosis: + runs-on: ubuntu-latest + environment: graph + steps: + - uses: actions/checkout@v3 + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Install dependencies + run: pnpm install + - name: Graph Codegen + working-directory: subgraphs/v3-pools + run: pnpm codegen subgraph.gnosis.yaml + - name: Graph Build + working-directory: subgraphs/v3-pools + run: pnpm build subgraph.gnosis.yaml + - name: Graph Deploy + working-directory: subgraphs/v3-pools + run: > + pnpm graph deploy + --deploy-key ${{secrets.GRAPH_DEPLOY_KEY}} + balancer-pools-v3-gnosis + subgraph.gnosis.yaml + --version-label ${GITHUB_SHA::8} + + deploy-sepolia: + runs-on: ubuntu-latest + environment: graph + steps: + - uses: actions/checkout@v3 + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Install dependencies + run: pnpm install + - name: Generate manifests + run: pnpm generate-manifests + - name: Graph Codegen + working-directory: subgraphs/v3-pools + run: pnpm codegen subgraph.sepolia.yaml + - name: Graph Build + working-directory: subgraphs/v3-pools + run: pnpm build subgraph.sepolia.yaml + - name: Graph Deploy + working-directory: subgraphs/v3-pools + run: > + pnpm graph deploy + --deploy-key ${{secrets.GRAPH_DEPLOY_KEY}} + balancer-pools-v3-sepolia + subgraph.sepolia.yaml + --version-label ${GITHUB_SHA::8} diff --git a/.github/workflows/graph-vault.yml b/.github/workflows/graph-vault.yml index 8e8a75e..abffc57 100644 --- a/.github/workflows/graph-vault.yml +++ b/.github/workflows/graph-vault.yml @@ -1,4 +1,4 @@ -name: Deploy Graph Studio Prod +name: Deploy Vault Subgraphs on: push: branches: main diff --git a/subgraphs/v3-pools/template.yaml b/subgraphs/v3-pools/subgraph.gnosis.yaml similarity index 81% rename from subgraphs/v3-pools/template.yaml rename to subgraphs/v3-pools/subgraph.gnosis.yaml index d717f6a..094564a 100644 --- a/subgraphs/v3-pools/template.yaml +++ b/subgraphs/v3-pools/subgraph.gnosis.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: WeightedPoolFactory - network: {{ network }} + network: gnosis source: abi: BasePoolFactory - address: "{{ WeightedPoolFactory.address }}" - startBlock: {{ WeightedPoolFactory.startBlock }} + address: "0xEB1eeaBF0126d813589C3D2CfeFFE410D9aE3863" + startBlock: 37371691 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -27,11 +27,11 @@ dataSources: file: ./src/mappings/weighted.ts - kind: ethereum name: StablePoolFactory - network: {{ network }} + network: gnosis source: abi: BasePoolFactory - address: "{{ StablePoolFactory.address }}" - startBlock: {{ StablePoolFactory.startBlock }} + address: "0x22625eEDd92c81a219A83e1dc48f88d54786B017" + startBlock: 37371860 mapping: kind: ethereum/events apiVersion: 0.0.7 diff --git a/subgraphs/v3-pools/subgraph.sepolia.yaml b/subgraphs/v3-pools/subgraph.sepolia.yaml new file mode 100644 index 0000000..6f35169 --- /dev/null +++ b/subgraphs/v3-pools/subgraph.sepolia.yaml @@ -0,0 +1,50 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum + name: WeightedPoolFactory + network: sepolia + source: + abi: BasePoolFactory + address: "0x7532d5a3bE916e4a4D900240F49F0BABd4FD855C" + startBlock: 7216947 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Factory + - Pool + abis: + - name: WeightedPool + file: ./abis/WeightedPool.json + - name: BasePoolFactory + file: ./abis/BasePoolFactory.json + eventHandlers: + - event: PoolCreated(indexed address) + handler: handleWeightedPoolCreated + file: ./src/mappings/weighted.ts + - kind: ethereum + name: StablePoolFactory + network: sepolia + source: + abi: BasePoolFactory + address: "0xd67F485C07D258B3e93835a3799d862ffcB55923" + startBlock: 7217020 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Factory + - Pool + abis: + - name: StablePool + file: ./abis/StablePool.json + - name: BasePoolFactory + file: ./abis/BasePoolFactory.json + eventHandlers: + - event: PoolCreated(indexed address) + handler: handleStablePoolCreated + file: ./src/mappings/stable.ts diff --git a/subgraphs/v3-pools/subgraph.yaml b/subgraphs/v3-pools/subgraph.yaml new file mode 100644 index 0000000..8eb3c87 --- /dev/null +++ b/subgraphs/v3-pools/subgraph.yaml @@ -0,0 +1,50 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum + name: WeightedPoolFactory + network: mainnet + source: + abi: BasePoolFactory + address: "0x201efd508c8DfE9DE1a13c2452863A78CB2a86Cc" + startBlock: 21336937 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Factory + - Pool + abis: + - name: WeightedPool + file: ./abis/WeightedPool.json + - name: BasePoolFactory + file: ./abis/BasePoolFactory.json + eventHandlers: + - event: PoolCreated(indexed address) + handler: handleWeightedPoolCreated + file: ./src/mappings/weighted.ts + - kind: ethereum + name: StablePoolFactory + network: mainnet + source: + abi: BasePoolFactory + address: "0xB9d01CA61b9C181dA1051bFDd28e1097e920AB14" + startBlock: 21337005 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Factory + - Pool + abis: + - name: StablePool + file: ./abis/StablePool.json + - name: BasePoolFactory + file: ./abis/BasePoolFactory.json + eventHandlers: + - event: PoolCreated(indexed address) + handler: handleStablePoolCreated + file: ./src/mappings/stable.ts