On March 13, 2023, the decentralized lending protocol Euler Finance suffered a devastating flash loan attack that resulted in the loss of approximately $197 million, making it the single largest DeFi exploit of the year. The attack sent shockwaves through the decentralized finance community and raised urgent questions about the security of lending protocols on Ethereum, particularly those that rely on complex liquidation mechanisms.
The Exploit Mechanics
The attacker exploited a critical vulnerability in Euler Finance’s donateToReserve() function, which lacked essential insolvency checks. This oversight allowed the attacker to deposit assets into a heavily leveraged position without the protocol verifying whether the position remained solvent after the donation. By manipulating this function, the attacker was able to reduce the health factor of their borrowed position below 100%, triggering a soft liquidation event that they themselves controlled.
Euler’s design incorporates a dynamic close factor for soft liquidations. The lower the health of a position, the more collateral becomes eligible for liquidation — up to 75% in cases of bad debt. The attacker exploited this mechanism by taking out a flash loan, using it to create an overleveraged position, donating tokens to reserves to tank the health factor, and then liquidating their own position at a steep discount. The discounted collateral was sufficient to repay the flash loan while leaving the attacker with a substantial profit.
The stolen funds were denominated in multiple assets: USDC, wrapped Bitcoin (wBTC), staked Ether (stETH), and DAI. Security firms BlockSec and PeckShield were among the first to identify and analyze the attack in real time.
Affected Systems
Euler Finance is a permissionless borrowing and lending protocol built on Ethereum. Unlike platforms such as Aave or Compound, Euler allows users to create lending markets for virtually any token with a Uniswap V3 pool. This flexibility, while innovative, introduces additional attack surfaces that traditional protocols do not expose.
The attack specifically targeted Euler’s lending pools on the Ethereum mainnet. All depositors in the affected pools — those holding USDC, wBTC, stETH, and DAI positions — were impacted by the exploit. The total value locked in Euler dropped precipitously following the attack, and the protocol suspended operations to assess the damage.
The Mitigation Strategy
Immediately following the attack, Euler Finance took several steps to contain the damage. The team paused vulnerable contracts and began coordinating with security researchers, on-chain analytics firms, and law enforcement. Chainalysis and TRM Labs were engaged to trace the movement of stolen funds through the blockchain.
In an unusual turn of events, the attacker — who identified themselves as “Jacob” — began returning the stolen funds just days after the exploit. On March 18, 2023, the attacker returned 3,000 ETH, followed by an additional 51,000 ETH on March 25. By early April, nearly all of the $197 million had been returned. The attacker communicated with the Euler team through encrypted on-chain messages, eventually apologizing for the exploit.
Notably, 100 ETH from the stolen funds was moved to an address previously associated with the Axie Infinity Ronin Bridge hack, which was carried out by the North Korean Lazarus Group. This raised questions about possible state-sponsored involvement, though it may have also been an attempt at misdirection.
Lessons Learned
The Euler Finance exploit highlights several critical lessons for the DeFi ecosystem. First, even well-audited protocols can harbor subtle vulnerabilities in complex financial logic. The donateToReserve() function was not a simple coding error but a design flaw where a financial invariant was not properly enforced. Second, the attack demonstrates that flash loans remain a powerful weapon in the hands of sophisticated attackers, enabling exploits that would previously have required massive capital. Third, the dynamic liquidation mechanism, while innovative, created an unintended profit pathway for attackers who could engineer their own liquidation events.
User Action Required
For users who had funds deposited in Euler Finance, the protocol launched a recovery process following the return of the stolen assets. Users should monitor official Euler Finance channels for updates on fund recovery. More broadly, this incident underscores the importance of diversifying across protocols, monitoring health factors in lending positions, and understanding the specific liquidation mechanics of each platform before depositing significant funds. As Bitcoin trades near $24,197 and Ethereum at $1,680 following the SVB banking crisis, market volatility remains elevated, making careful risk management more critical than ever.
Disclaimer: This article is for informational purposes only and does not constitute financial advice. Always conduct your own research before engaging with any DeFi protocol.
$197M gone because someone forgot to add an insolvency check in donateToReserve. one line of code. unreal
flash loans are the worst thing to happen to defi security. zero risk, infinite upside for attackers
flash loans are a tool not the problem. the real issue is protocols building complex liquidation logic without basic sanity checks. dont blame the hammer for bad construction
missing insolvency check in donateToReserve is the kind of thing a proper audit catches in 10 minutes. euler had multiple auditors and none flagged it
Chen Wei 10 minutes is optimistic. the function name implies donation which sounds harmless. auditors scan for missing checks on withdraw and borrow paths, not deposit helpers. the blind spot was structural not just negligence
The soft liquidation design was clever in theory but the 75% close factor on bad debt created a massive attack surface. auditors should have caught this
had funds in euler. not life changing money but still hurts. when does the exploit reimbursement happen?
euler eventually recovered most of the funds after negotiating with the attacker. took weeks but the on-chain forensics were impressive. not many people mention the recovery part
everybody praises the recovery but $20M of the $197M was never returned. the negotiation was chainalysis cornering the attacker while euler begged publicly on twitter. not exactly a model for future exploits