Introduction
A sophisticated exploit targeting Balancer v2’s Composable Stable Pools resulted in approximately $120 million in losses across the main protocol and multiple forks. Security firm SlowMist identified the root cause as a precision loss flaw in the platform’s fixed-point arithmetic calculations. The attackers methodically amplified small price discrepancies through carefully orchestrated swap sequences, revealing critical vulnerabilities in DeFi’s automated market maker infrastructure.
Key Points
- Attackers exploited precision loss in fixed-point arithmetic calculations for Composable Stable Pools handling near-parity assets
- The strategy involved repeated small swaps to accumulate errors while maintaining pool liquidity through restoration cycles
- Remediation included pool pausing, factory disabling, and recovery of $19M in osETH and $2M in osGNO through whitehat coordination
The Precision Flaw That Cost $120 Million
The November 3rd Balancer v2 exploit stemmed from a fundamental mathematical vulnerability in the protocol’s Composable Stable Pools, which are specifically designed for near-parity asset pairs such as USDC/USDT or WETH/stETH. According to SlowMist’s detailed post-incident analysis, the exploit originated from precision loss flaws in the integer fixed-point arithmetic used to calculate scaling factors within these specialized liquidity pools. This technical weakness created small but consistent price discrepancies during swap operations, particularly when attackers leveraged the batch swap function to chain multiple operations within single transactions.
The vulnerability became particularly dangerous under specific conditions where attackers could manipulate the system’s mathematical precision. SlowMist emphasized that the flaw allowed attackers to exploit the system through carefully controlled swap sequences, with the precision errors becoming more pronounced during operations involving small amounts. This mathematical weakness in the fixed-point arithmetic system ultimately enabled attackers to extract approximately $120 million from Balancer’s main protocol and its various forks, making it one of the most significant DeFi exploits of the year.
Anatomy of a Sophisticated Attack Strategy
The attackers executed a meticulously planned six-step strategy that leveraged the precision flaw to systematically drain funds while maintaining the appearance of normal pool operations. The process began with the attacker swapping BPT (Balancer Pool Tokens) for liquidity tokens to deliberately reduce the pool’s liquidity reserves, creating optimal conditions for small-amount swaps. This initial step was crucial for setting the stage for the precision manipulation that would follow.
Following the liquidity reduction, the attackers performed strategic swaps between liquidity tokens, specifically converting osETH to WETH, to establish precise control over the small-swap precision errors. The core of the exploit involved executing carefully controlled osETH to WETH swaps designed specifically to accumulate precision errors. After each error accumulation phase, the attackers would swap between liquidity tokens again, converting WETH back to osETH to restore sufficient liquidity in the pool.
The attackers repeated steps two through four in continuous loops, systematically amplifying the accumulated precision errors with each iteration. This repetitive process allowed them to compound what began as minor mathematical discrepancies into significant financial gains. The final step involved swapping the liquidity tokens back into BPT to return the pool to an apparently balanced state, effectively covering their tracks while pocketing massive profits from the manipulated transactions.
Forensic Investigation and Fund Recovery Efforts
SlowMist’s forensic investigation revealed sophisticated fund movement patterns across multiple blockchain networks. The security team traced the initial funds through privacy tool Tornado Cash, followed by routing through intermediate nodes and cross-chain transactions using gas.zip functionality. The stolen assets were ultimately assembled on Ethereum-based addresses containing thousands of ETH and WETH, demonstrating the attackers’ deliberate efforts to obscure the money trail across different blockchain environments.
In response to the exploit, Balancer’s remediation team implemented comprehensive emergency measures including pausing all vulnerable CSPv6 pools across the affected network, disabling the CSPv6 factory, and killing gauges for affected pools. Major liquidity providers safely withdrew their funds while the protocol coordinated recovery efforts. The Balancer team worked extensively with whitehat hackers, cybersecurity partners, and various network operators to retrieve or freeze portions of the stolen funds.
These coordinated efforts resulted in the recovery of significant assets, including 5,041 StakeWise osETH worth approximately $19 million and 13,495 osGNO valued at around $2 million. The successful recovery of approximately $21 million in stolen assets demonstrates the growing capability of DeFi protocols to respond to major security incidents through industry collaboration and rapid response mechanisms.
Lessons for DeFi Security and Future Precautions
The Balancer exploit highlights critical vulnerabilities in how DeFi protocols handle mathematical precision, particularly in systems designed for near-parity assets. SlowMist’s analysis provides crucial guidance for other project teams and auditors facing similar scenarios, emphasizing the need for enhanced test coverage for extreme cases and boundary conditions. The security firm specifically urged projects to pay particular attention to precision handling strategies under low-liquidity conditions, where mathematical vulnerabilities become most exploitable.
The incident underscores the sophisticated nature of modern DeFi attacks, where attackers combine deep protocol understanding with mathematical precision manipulation to extract value. The use of batch swap functions to chain multiple operations, combined with the strategic manipulation of liquidity levels, represents a new class of attack vectors that security auditors must now consider. As DeFi protocols continue to evolve in complexity, the Balancer incident serves as a stark reminder that mathematical precision in smart contract code requires rigorous testing and validation, especially for protocols handling significant liquidity across multiple asset types.
📎 Related coverage from: cryptopotato.com
