Balancer Hack
What happened
On June 28, 2020, an attacker used a dYdX flash loan to exploit Balancer V1 pools containing STA and STONK, ERC-20 tokens that charge a transfer fee. Balancer credited nominal input amounts in its internal reserve accounting even when the pool received less after the fee, allowing a reserve and price mismatch that drained the pools.
Case & protocol details
Attack Timeline
The attacker flash-borrowed WETH and repeatedly swapped it for STA, progressively reducing the pool's actual STA balance. Balancer's internal accounting credited the nominal STA input before the token transfer completed, but STA's fee meant the pool received less than recorded. After calling gulp() to synchronize the internal record to the depleted on-chain balance, the attacker made the remaining STA appear extremely valuable and swapped it for other pool assets.
The flash loan made the sequence atomic, but the root cause was the accounting incompatibility with fee-on-transfer tokens.
Security review history
- Trail of Bits No public report
- ConsenSys Diligence No public report
Evidence & learning
Attack pattern
Compare incidents →Sources and on-chain records
- report Report peckshield.medium.com
- report Report theblockcrypto.com
- report Report cointelegraph.com
- report Post-mortem medium.com
- transaction Transaction etherscan.io
Practice this exploit pattern safely
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.