# What happened in the Euler Finance hack?

URL: https://shield.quillaudits.com/exploits/euler-finance-2023/

On 13 March 2023 an attacker took [about $197M](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery) from Euler Finance, a lending protocol on Ethereum, in transactions that began at 08:50 UTC. The root cause was one missing check: `donateToReserves`, added in a later improvement proposal (eIP-14), let an account give away its collateral without checking the account's health, so the attacker pushed its own position underwater and liquidated it at a profit ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)). By 3 April the attacker had returned all recoverable funds, worth about $240M by then because the price of ETH had risen ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).

Last updated 3 December 2026. 6 minute read. By the QuillAudits Team.

## What is the timeline of the Euler Finance hack?

| Protocol | Euler Finance |
| --- | --- |
| Date | 13 March 2023 |
| Chain | Ethereum |
| Loss | about $197M |
| What happened | eIP-14 added donateToReserves, which moved an account's collateral to the reserves without the health check that withdrawals run. The attacker used a flash loan and Euler's own borrowing to build a large position, donated enough collateral to leave it with bad debt, then liquidated it from a second contract at the maximum discount and withdrew the profit. The attacker later returned all recoverable funds. |
| Sources | [Euler Labs](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery), [Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454), [Bloomberg](https://www.bloomberg.com/news/articles/2023-03-13/defi-s-euler-finance-hit-by-197-million-hack-experts-say) |

1. By July 2022: Euler patches a first-depositor bug that a white hat reported through its bug bounty, and the patch brings in `donateToReserves` ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)). Omniscia traces the function to eIP-14 ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)).
2. 13 March 2023, 08:50:23 UTC: the attacker deploys the exploit contract. The first theft, about $8.8M, lands at 08:50:59 ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
3. 13 March 2023, from 08:56 UTC: more exploit transactions follow over about 15 minutes, for a total of about $197M, most of it converted to ETH and DAI ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
4. 13 March 2023: Euler sends its first on-chain message to the attacker ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
5. 14 March 2023: Euler says it has disabled the vulnerable eToken module, which blocks deposits and the donation function ([Cointelegraph](https://cointelegraph.com/news/euler-finance-blocks-vulnerable-module-working-on-recovering-funds)). It also tells the attacker that a $1M reward for information will launch unless 90% of the funds come back within 24 hours ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
6. 18 March 2023: the attacker returns 3,000 ETH, about $5.3M, and Euler withdraws the reward offer ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
7. 25 March 2023, 15:08 UTC: 51,000 ETH, about $90M, comes back in one transfer, and more ETH and DAI follow over the next three days ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).
8. 3 April 2023, 22:49 to 22:59 UTC: the last transfers, 12M DAI and about 10,580 ETH, arrive ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)), and Euler Labs says all recoverable funds have been returned ([The Block](https://theblock.co/post/224705/euler-hacker-returns-funds)).

## What was the bug in donateToReserves?

Euler tracked each account's collateral as eTokens and its debt as dTokens. A transfer of eTokens normally ran a liquidity check, so the account could not end up with more debt than its collateral supports ([Zellic](https://www.zellic.io/blog/euler-finance-exploit-analysis)). `donateToReserves` moved eTokens from the caller's account into the protocol's reserves and skipped that check ([BlockSec](https://blocksec.com/blog/defi-exploit-analysis-root-cause-euler-s-200m)).

**Vulnerable: Euler's donateToReserves, simplified, not the original code (illustrative, not audited code)** `SimplifiedEToken.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

/// Euler v1 eToken accounting, cut down to the two paths that matter here.
contract SimplifiedEToken {
    mapping(address => uint256) public collateral; // eToken balance, in underlying units
    mapping(address => uint256) public debt; // dToken balance, in underlying units
    uint256 public reserves;

    // Euler v1 compared risk-adjusted values. This sketch compares raw amounts.
    function isHealthy(address account) public view returns (bool) {
        return collateral[account] >= debt[account];
    }

    function withdraw(uint256 amount) external {
        collateral[msg.sender] -= amount;
        // ... send `amount` of the underlying token to msg.sender
        require(isHealthy(msg.sender), "account would be unhealthy");
    }

    // Added by eIP-14. It lowers collateral exactly like a withdrawal,
    // but nothing checks the account's health afterwards.
    function donateToReserves(uint256 amount) external {
        collateral[msg.sender] -= amount;
        reserves += amount;
    }
}
```

A donation could therefore turn a healthy account into one with bad debt. On its own that only hurts the donor. It paid because of how Euler liquidated: the discount a liquidator gets grows as the account's health falls, up to a 20% maximum ([Cyfrin](https://cyfrin.io/blog/how-did-the-euler-finance-hack-happen-hack-analysis)), and when the collateral cannot cover the debt, the liquidation takes whatever collateral the account has ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)). CertiK's walk-through of the DAI transaction shows the steps ([CertiK](https://www.certik.com/blog/euler-finance-incident-analysis)):

1. Flash-borrow 30M DAI from Aave.
2. Deposit 20M DAI into Euler.
3. Call Euler's `mint` to borrow against the deposit at 10x: 195.6M eDAI of collateral and 200M dDAI of debt.
4. Repay 10M DAI, then mint again for another 195.6M eDAI and 200M dDAI.
5. Donate 100M eDAI to the reserves. The account now owes far more than its collateral covers.
6. From a second contract, liquidate the first at the 20% discount. Omniscia's figures show the liquidator taking about 310.93M eDAI of collateral and only about 259.31M dDAI of debt ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)).
7. Withdraw 38.9M DAI, repay the flash loan and keep the difference, about 8.88M DAI on this transaction ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)).

The attacker repeated the pattern in other markets. Omniscia names WETH ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)), and CertiK's list of assets taken also has WBTC, stETH and USDC ([CertiK](https://www.certik.com/blog/euler-finance-incident-analysis)). The fix is the check every other exit already ran.

**Fixed: the donation ends with the same health check as a withdrawal, simplified (illustrative, not audited code)** `SimplifiedETokenFixed.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

contract SimplifiedETokenFixed {
    mapping(address => uint256) public collateral;
    mapping(address => uint256) public debt;
    uint256 public reserves;

    function isHealthy(address account) public view returns (bool) {
        return collateral[account] >= debt[account];
    }

    function donateToReserves(uint256 amount) external {
        collateral[msg.sender] -= amount;
        reserves += amount;
        // Every path that lowers collateral ends here.
        require(isHealthy(msg.sender), "account would be unhealthy");
    }
}
```

Cyfrin states the invariant the change broke: the health score never goes below 1 unless the value of the underlying changes ([Cyfrin](https://cyfrin.io/blog/how-did-the-euler-finance-hack-happen-hack-analysis)). A user action should never do what only a price move may. The class of bug is covered on [liquidation logic bugs](https://shield.quillaudits.com/learn/vulnerabilities/liquidation-logic-bugs/).

## How much did Euler Finance lose?

About $197M, by Euler's own count ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)) and in [Bloomberg's report](https://www.bloomberg.com/news/articles/2023-03-13/defi-s-euler-finance-hit-by-197-million-hack-experts-say) the same day. Other outlets rounded it to almost $200M ([CoinDesk](https://www.coindesk.com/business/2023/04/03/euler-says-all-recoverable-funds-stolen-in-200m-hack-have-been-returned)). CertiK lists what left the pools, by asset ([CertiK](https://www.certik.com/blog/euler-finance-incident-analysis)):

| Asset | Amount |
| --- | --- |
| DAI | 8,877,507 |
| WETH | 8,080 |
| WBTC | 846.4 |
| stETH | 73,821 |
| USDC | 34,224,863 |

rekt.news, citing SlowMist, gives 849 WBTC rather than 846.4 ([rekt.news](https://rekt.news/euler-rekt)). The two counts agree on the total of about $197M.

## Did Euler get the money back?

Yes. Between 18 March and 3 April 2023 the attacker sent the funds back in stages, and on 3 April Euler Labs said all recoverable funds had been returned ([The Block](https://theblock.co/post/224705/euler-hacker-returns-funds)). Euler puts the total at about $240M against about $197M taken. Most of the stolen funds were held as ETH, and the price of ETH rose during the negotiation ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)). On 4 April the Euler Foundation said it would publish a plan to restore user deposits in the coming days ([CoinDesk](https://www.coindesk.com/business/2023/04/03/euler-says-all-recoverable-funds-stolen-in-200m-hack-have-been-returned)).

The bug arrived with a later improvement proposal to a protocol that was already live. Our guide to [reviewing changes since your last audit](https://shield.quillaudits.com/guides/review-changes-since-your-last-audit/) starts from that case: list every new entry point and check that it runs the same checks as the paths that were already there.

## What would a proof-of-concept-first audit test here?

Start from the invariant, then try to break it with real calls. An auditor who works proof of concept first would write a fuzz test that opens a position, calls each function that lowers collateral or raises debt, and asserts that the account is still healthy or that the call reverted. Donation is one of those functions, so the fuzzer tries every amount from zero to the full balance.

**Fuzz test sketch against a lending market interface (illustrative, not audited code)** `DonationKeepsAccountsHealthyTest.sol`

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

interface ILendingMarket {
    function deposit(uint256 amount) external;
    function borrow(uint256 amount) external;
    function donateToReserves(uint256 amount) external;
    function isHealthy(address account) external view returns (bool);
}

/// Foundry-style test. setUp() deploys the market under test and funds this contract.
contract DonationKeepsAccountsHealthyTest {
    ILendingMarket internal market;

    function testFuzz_donationNeverLeavesAccountUnhealthy(
        uint256 deposited,
        uint256 borrowed,
        uint256 donated
    ) external {
        deposited = 1 + (deposited % 1e24);
        borrowed = borrowed % deposited;
        market.deposit(deposited);
        market.borrow(borrowed);
        require(market.isHealthy(address(this)), "setup: healthy before the donation");

        try market.donateToReserves(donated % (deposited + 1)) {
            // If the donation went through, the account must still be healthy.
            require(market.isHealthy(address(this)), "donation left the account unhealthy");
        } catch {
            // A revert is the safe outcome.
        }
    }
}
```

- Run the same assertion after withdraw, transfer, borrow and donate: every exit for collateral ends in one health check.
- Add a self-liquidation test with prices held fixed: one owner controls both the borrower and the liquidator, and the owner's combined value must not go up.
- Keep the fuzzer on large positions with heavy borrowing too, because the discount that paid the attacker only reached its maximum on a badly unhealthy account.

QuillShield runs a full audit of a Solidity codebase in a Foundry project, builds a security graph and lists the invariants the code must keep. A separate reviewer agent tries to disprove each finding before you see it, and on full audits each finding that holds up comes with a proof of concept. It then checks every pull request against that graph. We have not run QuillShield on Euler's code, so this page makes no claim about what it would report there. [Run a full audit](https://shield.quillaudits.com/register) on your own code: sign-up is free, and new accounts get $50 in credit, good for up to half of an order. Before any audit, the [audit readiness checklist](https://shield.quillaudits.com/tools/smart-contract-audit-readiness-checklist/) helps you write these invariants down.

## FAQ

### Was the Euler Finance hack a flash loan attack?

A flash loan paid for it: the DAI transaction started with 30M DAI borrowed from Aave and repaid in the same transaction ([CertiK](https://www.certik.com/blog/euler-finance-incident-analysis)). The loan only supplied capital. The flaw was the missing health check in `donateToReserves`.

### Which change introduced the bug?

eIP-14, a later improvement proposal that added `donateToReserves` to the eToken module ([Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454)). Euler says the function came with its patch for a first-depositor bug reported through its bug bounty ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).

### Why did Euler get back more than was stolen?

Most of the stolen funds were held as ETH, and the price of ETH rose while Euler negotiated, so the returned assets were worth about $240M against about $197M taken ([Euler](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery)).

## Sources

- [War & Peace: behind the scenes of Euler's $240M exploit recovery, Euler Labs](https://euler.finance/blog/war-peace-behind-the-scenes-of-eulers-240m-exploit-recovery) · checked 3 December 2026
- [Euler Finance Incident Post-Mortem, Omniscia](https://medium.com/@omniscia.io/euler-finance-incident-post-mortem-1ce077c28454) · checked 3 December 2026
- [DeFi Lender Euler Finance Hit By $197 Million Hack, Experts Say, Bloomberg](https://www.bloomberg.com/news/articles/2023-03-13/defi-s-euler-finance-hit-by-197-million-hack-experts-say) · checked 3 December 2026
- [DeFi exploit analysis: the root cause of Euler's $200M loss, BlockSec](https://blocksec.com/blog/defi-exploit-analysis-root-cause-euler-s-200m) · checked 3 December 2026
- [Euler Finance exploit analysis, Zellic](https://www.zellic.io/blog/euler-finance-exploit-analysis) · checked 3 December 2026
- [How did the Euler Finance hack happen? Hack analysis, Cyfrin](https://cyfrin.io/blog/how-did-the-euler-finance-hack-happen-hack-analysis) · checked 3 December 2026
- [Euler Finance Incident Analysis, CertiK](https://www.certik.com/blog/euler-finance-incident-analysis) · checked 3 December 2026
- [Euler Finance: REKT, rekt.news](https://rekt.news/euler-rekt) · checked 3 December 2026
- [Euler Finance blocks vulnerable module, working on recovering funds, Cointelegraph](https://cointelegraph.com/news/euler-finance-blocks-vulnerable-module-working-on-recovering-funds) · checked 3 December 2026
- [Euler hacker returns $31 million, marking end to 'recoverable funds' in DeFi exploit, The Block](https://theblock.co/post/224705/euler-hacker-returns-funds) · checked 3 December 2026
- [Euler Says All 'Recoverable Funds' Stolen in $200M Hack Have Been Returned, CoinDesk](https://www.coindesk.com/business/2023/04/03/euler-says-all-recoverable-funds-stolen-in-200m-hack-have-been-returned) · checked 3 December 2026
