Skip to content

Commit

Permalink
Merge pull request #6 from balancer/dev
Browse files Browse the repository at this point in the history
fix protocol fees amounts, generate manifests
  • Loading branch information
mendesfabio authored Jan 22, 2025
2 parents 5fb8b8a + 183b138 commit 76bf466
Show file tree
Hide file tree
Showing 16 changed files with 2,780 additions and 52 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/graph-pools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
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.yaml
Expand Down Expand Up @@ -51,6 +53,8 @@ jobs:
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.gnosis.yaml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/graph-vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
version: 8
- name: Install dependencies
run: pnpm install
- name: Generate manifests
run: pnpm generate-manifests
- name: Graph Codegen
working-directory: subgraphs/v3-vault
run: pnpm codegen subgraph.yaml
Expand Down Expand Up @@ -51,6 +53,8 @@ jobs:
version: 8
- name: Install dependencies
run: pnpm install
- name: Generate manifests
run: pnpm generate-manifests
- name: Graph Codegen
working-directory: subgraphs/v3-vault
run: pnpm codegen subgraph.gnosis.yaml
Expand Down
52 changes: 46 additions & 6 deletions networks.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,56 @@
{
"mainnet": {
"Vault": {
"address": "0xbA1333333333a1BA1108E8412f11850A5C319bA9",
"startBlock": 21332121
},
"ProtocolFeeController": {
"address": "0xa731C23D7c95436Baaae9D52782f966E1ed07cc8",
"startBlock": 21332121
},
"WeightedPoolFactory": {
"address": "0x201efd508c8DfE9DE1a13c2452863A78CB2a86Cc",
"startBlock": 21336937
},
"StablePoolFactory": {
"address": "0xB9d01CA61b9C181dA1051bFDd28e1097e920AB14",
"startBlock": 21337005
}
},
"gnosis": {
"Vault": {
"address": "0xbA1333333333a1BA1108E8412f11850A5C319bA9",
"startBlock": 37360338
},
"ProtocolFeeController": {
"address": "0xa731C23D7c95436Baaae9D52782f966E1ed07cc8",
"startBlock": 37360338
},
"WeightedPoolFactory": {
"address": "0xEB1eeaBF0126d813589C3D2CfeFFE410D9aE3863",
"startBlock": 37371691
},
"StablePoolFactory": {
"address": "0x22625eEDd92c81a219A83e1dc48f88d54786B017",
"startBlock": 37371860
}
},
"sepolia": {
"Vault": {
"address": "0x68aD967ae8393B722EC69dB1018Ec28AF9A34493",
"startBlock": 6924029
"address": "0xbA1333333333a1BA1108E8412f11850A5C319bA9",
"startBlock": 7212247
},
"ProtocolFeeController": {
"address": "0xa731C23D7c95436Baaae9D52782f966E1ed07cc8",
"startBlock": 7212247
},
"WeightedPoolFactory": {
"address": "0x4F12F60148F98aD920b99e844807F0e245f2AE58",
"startBlock": 6924094
"address": "0x7532d5a3bE916e4a4D900240F49F0BABd4FD855C",
"startBlock": 7216947
},
"StablePoolFactory": {
"address": "0xD895059a81711e4955823ED2C0755F204A86E5DA",
"startBlock": 6924116
"address": "0xd67F485C07D258B3e93835a3799d862ffcB55923",
"startBlock": 7217020
}
}
}
2 changes: 1 addition & 1 deletion scripts/generate-manifests.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function replacePlaceholders(template, network, networkData) {

Object.entries(networksData).forEach(([network, networkData]) => {
const config = replacePlaceholders(template, network, networkData);
const outputPath = path.join('subgraphs', subgraph, `subgraph.${network}.yaml`);
const outputPath = path.join('subgraphs', subgraph, `subgraph${network === 'mainnet' ? '' : `.${network}`}.yaml`);
fs.writeFileSync(outputPath, config);
console.log(`Generated ${outputPath}`);
});
Expand Down
50 changes: 50 additions & 0 deletions subgraphs/v3-pools/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
specVersion: 1.0.0
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum
name: WeightedPoolFactory
network: {{ network }}
source:
abi: BasePoolFactory
address: "{{ WeightedPoolFactory.address }}"
startBlock: {{ WeightedPoolFactory.startBlock }}
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: {{ network }}
source:
abi: BasePoolFactory
address: "{{ StablePoolFactory.address }}"
startBlock: {{ StablePoolFactory.startBlock }}
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
Loading

0 comments on commit 76bf466

Please sign in to comment.