The Balancer Exploit: How $121M Was Lost to a Rounding Error and
A rounding inconsistency in Balancer V2 Composable Stable Pools allowed an attacker to perform micro-swaps that gradually reduced the pool invariant, enabling them to withdraw more value than they should. The attacker exploited this across multiple chains to drain approximately $121.1M.
On November 3, 2025, at 7:46 AM UTC, the Balancer V2 protocol suffered one of the most sophisticated exploits in DeFi history. A subtle rounding inconsistency in Composable Stable Pools enabled attackers to drain approximately $121.1M across Ethereum, Arbitrum, Base, Optimism, and Polygon.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a rounding direction mismatch in the pool's scaling logic: upscaling used mulDown (always rounding down) while downscaling used divUp/divDown, causing the EXACT_OUT swap path to understate the required input amount.
What the attacker needed
Access to Balancer V2 Composable Stable Pools; Pools with rate providers and low liquidity; Ability to execute batchSwap transactions
The fix
The fix should separate decimal normalization from rate application, apply rates with rounding that favors the pool, add invariant guards, and restrict low-liquidity operations.
How it was found
- Gather comprehensive pool state data including token scaling factors, amplification parameters, fees, and balances.
- Deploy a simulation contract and repeatedly call a helper function with arrays of balances, scaling factors, token indices, desired output amounts, amplification, and fees to find exploitable swap amounts.
- Execute atomic batchSwap transactions: first swap BPT for underlying tokens to position a token at a rounding edge.
- Perform a crafted EXACT_OUT swap that, due to rounding asymmetry, understates the required input and reduces the pool invariant.
- Swap underlyings back into BPT at the deflated virtual price to extract excess value.
- Repeat these swaps within a single atomic transaction to compound the effect across multiple pools and chains.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This bug was a tiny maths error in how a DeFi pool calculated swap amounts. By making many small trades, the attacker could slowly trick the pool into giving them more money than they put in, eventually stealing millions.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.