A lending market has no path to handle under-water positions where collateral < debt after a crash. Liquidators avoid unprofitable liquidations, bad debt accrues silently, and the last withdrawers are left insolvent (bank run).
// price gaps down 40% in one block; a position is 90% collateralised. // liquidation is unprofitable so nobody liquidates -> the shortfall // becomes the depositors' loss on a first-come-first-served exit.
// track and socialise bad debt, or backstop with a reserve/insurance fund
if (collateralValue < debt) { _socialiseLoss(debt - collateralValue); }
Largest recorded losses in the same failure class — related, not the same bug:
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0221 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.