Where the Money Actually Disappears
Oracles, Liquidation Incentives and Bad Debt
A lending protocol is three parameters — oracle, liquidation bonus, close factor — and almost every insolvency traces to a mismatch between them and the collateral's real liquidity.
On-chain credit is a machine with no discretion. Nobody calls the borrower; a price feed updates and a liquidation either executes profitably or it does not. Solvency therefore depends on a small set of published parameters and on whether the market can actually absorb the collateral at the price the oracle is reporting. When those two diverge, bad debt appears immediately and permanently.
The oracle tradeoff, which has no clean answer
- Push oracles with a deviation threshold and a heartbeat. A feed updates when price moves beyond a set percentage, or after a maximum interval. Robust, aggregated off-chain, and by construction slightly stale — the deviation threshold is a known blind spot an attacker can price.
- Time-weighted average price from an on-chain pool. Manipulation-resistant, because moving an average requires holding a dislocated price across many blocks. Also lagging by design, which means it under-reports collateral damage in exactly the fast crash where accurate reporting matters most.
- Spot price from a pool. Cheap, instant, and the single most reliably exploited design in DeFi history.
There is no configuration that is both fast and manipulation-resistant, which is why the choice must be matched to the collateral. A deep, widely traded asset tolerates a faster feed because manipulating it is expensive. A thin, concentrated token requires a lagging feed, which in turn means its loan-to-value must be conservative enough to survive the lag. Listing a thin asset with a fast oracle and a generous LTV is the recurring setup behind oracle-manipulation losses — the Mango Markets attack in October 2022, roughly $110m, is the textbook public case: inflate a thin perp market, borrow against the inflated collateral, walk away.
Liquidation incentives have to clear real costs
A liquidator is a profit-seeking bot. It acts only when the bonus exceeds its total cost: gas, the price impact of unwinding the seized collateral, flash-loan fees, and the MEV it must pay to be included. Typical bonuses run in the 5-10% range. The correct question is never whether that sounds generous — it is whether 5-10% exceeds the slippage of dumping that specific position into that specific pool during a market-wide move, when every other liquidator is dumping simultaneously and the pool is thinner than usual.
- Oracle updatesposition breaches its threshold
- Bot computesbonus versus gas + slippage + MEV cost
- Profitableliquidated, protocol stays solvent
- Not profitablenobody acts, position rots into bad debt
Concentration is the risk nobody prices
The structural danger is a single borrower whose position is large relative to the collateral's real liquidity. That position cannot be liquidated at the oracle price by anyone, at any bonus, because the act of liquidating it moves the price past the point of profitability. The protocol then faces a choice between absorbing the loss and intervening through governance. Both have happened. Before trusting a lending market, look at the largest positions per collateral asset and compare them to that asset's genuine depth — the data is public and almost nobody checks it.
Recursive collateral and correlated unwinds
Liquid staking and restaking tokens introduce loops: deposit the derivative, borrow the base asset, mint more derivative, repeat. Each turn is individually overcollateralised and the stack as a whole is levered several times over. The failure mode is not insolvency of any single position but correlation — the derivative trades at a discount to its underlying precisely when everyone needs to exit, because redemption has a queue and the secondary market is the only immediate door. The stETH discount of 2022 reached several percent for exactly this reason. It then narrowed through late 2022, well before withdrawals actually opened with the Shapella upgrade in April 2023, as that date became credible — the discount was pricing confidence in the exit rather than the exit itself, which is why a queue you cannot use yet still has a price.
Key takeaways
Educational content only, not financial advice. Trading and investing carry real risk of loss, including your entire capital. Do your own research and consult a licensed professional before making financial decisions.
This is one lesson of 541.
The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.