Skip to content

Commit

Permalink
fix integration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mendesfabio committed Oct 16, 2024
1 parent 802f483 commit 9a09f0d
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions docs/new-pool-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To integrate new pool types into the Balancer subgraph, follow these steps below

## Setup

Navigate to the `subgraphs/v3-pools` directory before starting the integration process.
Navigate to the `subgraphs/v3-pools` directory and add your custom pool ABI to `abis` folder before starting the integration process.

## Updating the GraphQL Schema

Expand Down Expand Up @@ -43,13 +43,13 @@ Navigate to the `subgraphs/v3-pools` directory before starting the integration p
}
```

2. Save the `schema.graphql` file. Run the codegen command to generate types from your ABIs:
2. Save the file and run the codegen command to generate types for your schema:

```bash
pnpm codegen
```

## Creating the Subgraph Manifest
## Updating the Subgraph Manifest

1. Update the `subgraph.sepolia.yaml` file to include your new pool factory:

Expand All @@ -60,33 +60,41 @@ Navigate to the `subgraphs/v3-pools` directory before starting the integration p
name: CustomPoolFactory
network: sepolia
source:
address: "0x..." # Your custom pool factory address
abi: BasePoolFactory
address: "0x..." # Your custom pool factory address
startBlock: 000000 # Your custom pool deployment block
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/custom.ts
entities:
- Pool
- CustomParams
abis:
- name: CustomPool
file: ./abis/CustomPool.json
- name: BasePoolFactory
file: ./abis/BasePoolFactory.json
eventHandlers:
- event: PoolCreated(indexed address,bytes32)
handler: handleCustomPoolCreated
```

## Implementing Pool Factory Mapping
2. Save the file and run the codegen command to generate types for your ABIs:

```bash
pnpm codegen
```

## Writing Mappings for the Pool Factory

1. Update `src/mappings/common.ts` to include your new pool type:

```typescript
export class PoolType {
static Weighted: string = "Weighted";
static Stable: string = "Stable";
static Custom: string = "Custom"; // Add your new pool type here
export namespace PoolType {
export const Weighted = "Weighted";
export const Stable = "Stable";
export const Custom = "Custom"; // Add your new pool type here
}
```

Expand Down

0 comments on commit 9a09f0d

Please sign in to comment.