What happened in the Balancer V2 exploit?
At 7:46 AM UTC on 3 November 2025 an attacker hit Balancer V2's Composable Stable Pools through incorrect rounding in the "exact out" swap path (Balancer). Balancer estimates $94.8M of user funds stolen from the pools it deployed, and BlockSec, counting forks of the same code on other chains, puts total losses above $125M (BlockSec). Trail of Bits found that the rounding direction issue had been in the code for many years, and confirmed that Balancer v3 was not affected (Trail of Bits).
What is the timeline of the Balancer exploit?
| Protocol | Balancer V2 Composable Stable Pools |
|---|---|
| Date | 3 November 2025 |
| Chain | Ethereum and other chains |
| Loss | $94.8M (Balancer, its own pools); above $125M (BlockSec, with forks) |
| What happened | Balancer V2 scales every balance and swap amount with a helper that always rounds down. Inside one batch swap the attacker set a token's balance on a rounding boundary and made a swap whose rounded-down input understated its cost. That shrank the pool's invariant and the price of the pool token, and the attacker withdrew the profit in a separate transaction. |
| Sources | Balancer, BlockSec, Check Point Research |
- 3 November 2025, 07:46 UTC: the attack on Balancer V2's Composable Stable Pools begins (Balancer).
- 07:48 UTC: the exploiter moves 6,587 WETH, 6,851 osETH and 4,259 wstETH to a new wallet (DappRadar).
- 3 November: Balancer says it is aware of a potential exploit affecting Balancer v2 pools and is investigating with high priority (The Block).
- 10:02 UTC: Balancer offers the attacker a 20% white-hat bounty, valid for 48 hours (DappRadar).
- 10:11 UTC: Berachain's validators halt the network to recover, through an emergency hard fork, the funds taken from its exchange BEX in the Balancer-related exploit (DappRadar).
- 15:59 UTC: Sonic freezes the attacker's wallet (DappRadar).
- 4 November, 08:11 UTC: Balancer reports $19.3M recovered through a white-hat counter-exploit (DappRadar).
- 5 November: Balancer explains that the attacker manipulated the rounding in EXACT_OUT swaps, and repeats its 20% bounty offer (DappRadar).
- 24 March 2026: co-founder Fernando Martinelli says Balancer Labs, the company behind the protocol, will wind down, with development moving to the DAO and foundation and the protocol still running (AOL Finance).
What was the rounding bug in Balancer V2?
Balancer V2 pools do their math in 18-decimal fixed point, so every balance and swap amount is first multiplied by a scaling factor. Check Point's analysis shows that step as _upscaleArray calling FixedPoint.mulDown, which always rounds down (Check Point). Balancer's post-mortem names the core problem as incorrect rounding in the "exact out" swap path (Balancer).
Vulnerable: the scaling step of an exact out swap, simplified, not the original code (illustrative, not audited code) StablePoolScalingSketch.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
/// The scaling step of a Balancer V2 stable pool swap, cut down to the rounding that mattered.
contract StablePoolScalingSketch {
uint256 internal constant ONE = 1e18;
// Like FixedPoint.mulDown: multiply, then divide, rounding down.
function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {
return (a * b) / ONE;
}
// Every balance goes through the same helper, in the same direction.
function upscaleArray(uint256[] memory amounts, uint256[] memory scalingFactors) internal pure {
for (uint256 i = 0; i < amounts.length; i++) {
amounts[i] = mulDown(amounts[i], scalingFactors[i]);
}
}
function scaleForExactOutSwap(
uint256[] memory balances,
uint256[] memory scalingFactors,
uint256 amountOut,
uint256 indexOut
) public pure returns (uint256[] memory, uint256) {
upscaleArray(balances, scalingFactors);
// The amount leaving the pool is rounded down too. With a balance of a few wei and a
// scaling factor above 1e18, the lost fraction is a large share of the trade, and the
// invariant the pool computes from these numbers comes out too low.
uint256 scaledOut = mulDown(amountOut, scalingFactors[indexOut]);
return (balances, scaledOut);
}
}
BlockSec's analysis shows how the attacker used it. In a single batch swap, the attacker set one token's balance on a rounding boundary, then made a swap whose rounded-down input understated what it should have cost. That shrank the pool's invariant, and because the pool token's price is the invariant divided by its supply, it lowered that price. The attacker took the profit by withdrawing in a separate transaction (BlockSec).
Check Point adds the scale: balances pushed down to 8 or 9 wei, where one unit of rounding is a large share of the balance, and the swap cycle repeated about 65 times inside one batchSwap call (Check Point). Rounding down is right for what a pool pays out and wrong for what it must collect. A helper that rounds every amount the same way is only safe while the error stays dust. The class is covered on rounding and precision errors.
How much was stolen from Balancer?
The estimates count different things, so this page gives them side by side. Balancer counts only the pools it deployed. BlockSec adds forks of the same code on other chains.
| Source | Estimate | What it counts |
|---|---|---|
| Balancer post-mortem | $94.8M | User funds stolen from the pools Balancer deployed |
| BlockSec | Above $125M | Total losses, including forks on other chains |
| PeckShield, via The Block | $128.6M | Outflows across chains, estimated on 3 November |
| Check Point Research | $128.64M | Total across six networks |
| Trail of Bits | More than $100M | Drained across nine networks |
What happened after the Balancer exploit?
Within hours Balancer offered a 20% white-hat bounty, valid for 48 hours, and repeated the offer on 5 November. Chains with Balancer-based exchanges acted on their own: Berachain's validators halted the network to recover funds through an emergency hard fork, and Sonic froze the attacker's wallet. On 4 November Balancer reported $19.3M recovered through a white-hat counter-exploit (DappRadar).
On 24 March 2026, co-founder Fernando Martinelli said Balancer Labs, the company behind the protocol, would wind down. Development would move to the DAO and foundation, and the protocol would keep running (AOL Finance).
What would a proof-of-concept-first audit test here?
Write the invariant down, then fuzz it from the worst starting point. For a stable pool, a swap should never lower the invariant per pool token: fees can raise it, and rounding must not lower it. Trail of Bits' guidance after the hack says the same in general terms: document every invariant about precision loss and rounding direction, then test them with strong fuzzing campaigns (Trail of Bits).
Invariant fuzz test sketch for exact out swaps (illustrative, not audited code) ExactOutSwapInvariantTest.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
interface IStablePoolHarness {
function getInvariant() external view returns (uint256);
function totalSupply() external view returns (uint256);
function swapExactOut(uint256 indexIn, uint256 indexOut, uint256 amountOut)
external
returns (uint256 amountIn);
}
/// Foundry-style test. setUp() deploys a harness around the pool math and seeds balances of a few wei.
contract ExactOutSwapInvariantTest {
IStablePoolHarness internal pool;
function invariantPerPoolToken() internal view returns (uint256) {
return (pool.getInvariant() * 1e18) / pool.totalSupply();
}
function testFuzz_exactOutSwapsNeverLowerInvariantPerPoolToken(uint256 seed, uint8 swaps) external {
uint256 last = invariantPerPoolToken();
uint256 count = (uint256(swaps) % 64) + 1;
for (uint256 i = 0; i < count; i++) {
uint256 tokenIn = i % 2;
uint256 tokenOut = 1 - tokenIn;
uint256 amountOut = 1 + (uint256(keccak256(abi.encode(seed, i))) % 1e6);
try pool.swapExactOut(tokenIn, tokenOut, amountOut) {
uint256 current = invariantPerPoolToken();
require(current >= last, "an exact out swap lowered the invariant per pool token");
last = current;
} catch {
// A swap the pool refuses is fine.
}
}
}
}
- Seed the pool with balances of a few wei as well as realistic ones. Check Point describes the attack working at 8 or 9 wei.
- Let the fuzzer chain many exact out swaps in one transaction and check the invariant after each one, since the attack repeated its cycle inside one batch swap.
- Run the suite for every scaling factor in use, including factors that are not exactly 1e18.
- Rerun it whenever a rounding helper changes. Trail of Bits notes that a function that rounds up today may need to round down after a later update (Trail of Bits).
A QuillShield full audit reviews the arithmetic across the whole Solidity codebase in scope, lists the invariants the code must keep, and on full audits each finding that holds up comes with a proof of concept, so you can see whether a remainder can actually be taken. It then checks every pull request against the audit, so a new fee or a refactored conversion is reviewed next to the code it has to agree with. We have not run QuillShield on Balancer's code, so this page makes no claim about what it would report there. Run a full audit on your own pool: sign-up is free, and new accounts get $50 in credit, good for up to half of an order. The audit readiness checklist covers what to prepare.
FAQ
Was Balancer v3 affected?
No. Trail of Bits independently confirmed that Balancer v3 was not affected (Trail of Bits).
Was the Balancer hack an access control bug?
How can a few wei of rounding drain a pool?
At normal balances the rounding error is dust. With a balance pushed down to 8 or 9 wei, one unit is a large share of it, and repeating the swap cycle about 65 times in one batch swap stacked the error (Check Point).
Sources
- Nov 3 Exploit Post-Mortem, Balancer checked 24 November 2026
- In-Depth Analysis: The Balancer V2 Exploit, BlockSec checked 24 November 2026
- Balancer hack analysis and guidance for the DeFi ecosystem, Trail of Bits checked 3 December 2026
- How an attacker drained $128M from Balancer through rounding error exploitation, Check Point Research checked 3 December 2026
- Balancer exploit, November 2025, DappRadar checked 3 December 2026
- DeFi protocol Balancer potentially exploited as onchain data shows millions in outflows, The Block checked 3 December 2026
- Explained: the Balancer hack (November 2025), Halborn checked 3 December 2026
- Major crypto firm announces shutdown after $116M hack, AOL Finance checked 3 December 2026