Remove Liquidity Guide
Balancer v3 supports several different types of remove liquidity operations
Core Concepts
The core concepts of removing liquidity are the same for any programming language or framework:
- When removing liquidity the user sends Balancer Pool Tokens (BPTs), and will receive pool tokens
- Use a
permit
signature to approve the Router to spend BPT - Token amount inputs/outputs are always in the raw token scale, e.g.
1 USDC
should be sent as1000000
because it has 6 decimals - If a pool's tokens include an ERC4626 with an initialized buffer, you have the option to receive the
asset()
of the ERC4626 when removing liquidity. - Transactions are always sent to a Router
- Use the standard
Router
to receive standard pool tokens - Use the
CompositeLiquidityRouter
to receive a pool's underlying tokens
- Use the standard
Example Scripts
Run example scripts against a local fork of Ethereum mainnet using the v3 pool operation examples repo
TypeScript SDK
- removeLiquidityProportional.ts
- removeLiquidityProportionalFromERC4626Pool.ts
- removeLiquiditySingleTokenExactIn.ts
- removeLiquiditySingleTokenExactOut.ts
Solidity
- RemoveLiquidityProportional.s.sol
- RemoveLiquidityProportionalFromERC4626Pool.s.sol
- RemoveLiquiditySingleTokenExactIn.s.sol
- RemoveLiquiditySingleTokenExactOut.s.sol