https://github.com/balancer/pool-operation-examples-v3
Example scripts for Balancer v3 pool operations
https://github.com/balancer/pool-operation-examples-v3
Last synced: 10 months ago
JSON representation
Example scripts for Balancer v3 pool operations
- Host: GitHub
- URL: https://github.com/balancer/pool-operation-examples-v3
- Owner: balancer
- Created: 2025-02-13T01:30:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-02T23:31:43.000Z (over 1 year ago)
- Last Synced: 2025-03-11T13:54:44.835Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SDK Examples
A collection of example scripts that illustrate how to use the Balancer SDK to create pools, swap tokens, add liquidity, and remove liquidity. Everything is configured to run on a local fork of Ethereum mainnet and use the [Balancer Aave Lido wETH-wstETH pool](https://balancer.fi/pools/ethereum/v3/0xc4ce391d82d164c166df9c8336ddf84206b2f812)
## Getting Started
1. Clone this repo & install dependencies
```
git clone https://github.com/balancer/pool-operation-examples-v3.git
cd pool-operation-examples-v3
pnpm install
```
2. Add a `MAINNET_RPC_URL` to a `.env` file
```
MAINNET_RPC_URL=
```
3. Run an example script
```
npx hardhat run scripts/hardhat/add-liquidity/addLiquidityProportional.ts
```
## Example Scripts
### Create Pool
- createPoolStable.ts
- createPoolStableSurge.ts
- createPoolWeighted.ts
### Swap Tokens
- swapCustomPath.ts
- swapSmartPath.ts
### Add Liquidity
- addLiquidityProportional.ts
- addLiquidityProportionalToERC4626.ts
- addLiquidityUnbalanced.ts
- addLiquidityUnbalancedToERC4626.ts
### Remove Liquidity
- removeLiquidityProportional.ts
- removeLiquidityProportionalFromERC4626Pool.ts
- removeLiquiditySingleTokenExactIn.ts
- removeLiquiditySingleTokenExactOut.ts