Curriculum·G201 Invariant Thinking·about 29 min

Writing the invariants of a position you hold

By the end of this lesson you can

  • Write the full set of invariants for a leveraged position you hold, not just the one that is obvious
  • Explain how the Aave CRV event turned one trader's failed attack into bad debt the protocol's other users carried
  • Compute the health factor and the liquidation buffer that a solvency invariant depends on, and where a thin market breaks it
  • Distinguish an invariant you can enforce yourself from one you are trusting somebody else to enforce

Graduate · enrolled learners

This lesson opens with Aave v2 CRV bad debt, 22 November 2022.

What happened
Avraham Eisenberg, the trader linked to the Mango Markets exploit a month earlier, borrowed about 92 million CRV tokens against roughly 90 million USDC of collateral on Aave v2, intending to sell the borrowed CRV and drive its price down so that Curve founder Michael Egorov's large CRV-backed loan would become liquidatable. The price did not fall as planned; CRV rose, Eisenberg's own borrowed position became undercollateralized, and it was liquidated at a reported loss to him of around 10 million dollars. But CRV was thinly traded relative to the position size, so the liquidation could not clear his debt at the prices the protocol assumed, and Aave was left holding about 1.78 million dollars of bad debt that its depositors and treasury absorbed. Aave later governance-purchased CRV to clear it.
The decision point
A depositor in Aave was trusting one invariant above all: the protocol stays solvent, so the assets backing the pool are always worth at least the deposits. That invariant was not enforced by anything the depositor controlled. It was enforced by an oracle, a liquidation engine, and an assumption that any position could be liquidated into the market fast enough and deep enough to cover its debt. A single position large relative to its token's liquidity broke the assumption, the liquidation left a hole, and the hole was socialized to everyone in the pool. The depositor who wrote down only the obvious invariant, my deposit earns yield, missed the one that actually determined whether they got their money back, and missed that they were not the one enforcing it.
Recorded loss
$1,780,000

What you will be able to answer

  • The invariants of a leveraged position?
  • How did a failed attack become bad debt for others on Aave?
  • The assumption behind pool solvency?
  • Enforced versus trusted invariant?

Orientation and Year One are open: anyone can read them without an account. From Year Two onward the lessons are for enrolled learners, because progress through the later years only means anything if it is tracked against a record.

It is free. We do not sell the list and there is nothing to buy at the end of it.

Sources and review

Confidence high·Volatility medium·Reviewed 2026-09-14·Owner unassigned

Contested

The bad-debt figure is reported between about 1.6 and 2.7 million dollars across sources depending on the CRV price used; 1.78 million is the commonly cited figure and is used with that caveat.

J304 owns liquidation mechanics as a borrower's numeracy problem. This lesson owns the invariant framing from the depositor's side. Keep the split.