Hooks
Small contracts that run at fixed points: before a swap, after a deposit, when a pool is created. They let a pool change fees or block actions without forking the protocol.
Balancer V3 went live in December 2024. It keeps the single-Vault idea from V2, moves the hard parts into the Vault, and opens every pool to custom logic through hooks.
Small contracts that run at fixed points: before a swap, after a deposit, when a pool is created. They let a pool change fees or block actions without forking the protocol.
Every token in a boosted pool can sit in a yield-bearing vault such as Aave. The pool keeps a small buffer for swaps, so liquidity providers earn lending yield on almost the full balance.
Accounting, rate scaling and fee handling moved from pools into the Vault. A new pool type can be a few hundred lines of math instead of thousands of lines of plumbing.
Using transient storage, the Vault tracks debts and credits during a transaction and only settles the net amount at the end. Multi-hop swaps get cheaper.
Approvals go through Permit2, so one signature can replace an approve transaction. Routers can be swapped or extended without touching the Vault.
Buffers wrap and unwrap yield tokens inside the Vault. A trader swapping USDC never needs to know the pool actually holds a lending receipt token.
Routers talk to the Vault. The Vault talks to pools, hooks and buffers. Pools only do math.
These are patterns developers already build on Balancer V3. Each one is a separate contract a pool opts into at creation.
Raise the swap fee when volatility is high and lower it when the market is calm. Liquidity providers are paid more for taking more risk.
onComputeDynamicSwapFee(params) {
const vol = oracle.volatility();
return base + vol * multiplier;
}| Area | Balancer V2 | Balancer V3 |
|---|---|---|
| Custom logic | Fork a pool contract | Attach a hook |
| Yield-bearing tokens | Rate providers, partial boosting | Native, 100% boosted |
| Token approvals | Approve the Vault | Permit2 signatures |
| Multi-hop gas | Settles per batch | Net settlement with transient storage |
| New pool type effort | Weeks | Days |
Deploy a pool, attach a hook, and the router will find it.