liquidation
Liquidation is how a lending protocol stays solvent when a borrower's collateral can no longer safely cover their debt. The moment a position crosses its liquidation threshold — its collateralization ratio dips too low, or its health factor falls below 1 — the protocol opens it up for anyone to close. A liquidator repays some or all of the bad debt out of their own pocket and, in return, seizes an equivalent value of the borrower's collateral plus a discount, the liquidation bonus or penalty (often 5% to 15%). The borrower keeps their borrowed funds but loses collateral worth more than the debt repaid.
Liquidations are run not by the protocol but by a competitive swarm of keeper bots watching every position and every price update. The bonus is the bait: it must be large enough that liquidators rush in and absorb the gas and price risk, but small enough that borrowers are not punished excessively. Two main designs exist. Fixed-bonus liquidation (Aave, Compound) lets a liquidator instantly repay debt and grab discounted collateral in one transaction. Auction-based liquidation (MakerDAO) sells the seized collateral through a Dutch or English auction so the market, rather than a fixed discount, sets the price.
Because liquidations sell collateral into the market, they can become reflexive and dangerous at scale. A falling price triggers liquidations, those forced sales push the price down further, which triggers still more liquidations — a liquidation cascade that can drain liquidity and, in extreme cases, leave the protocol with bad debt the collateral could not cover. Flash loans intensify this by letting a liquidator borrow the repayment capital with zero upfront funds, making liquidation extremely capital-efficient but also tightly coupling all of DeFi together.
Liquidation is a feature, not a bug: it is the mechanism that lets a permissionless, over-collateralized market exist without trusting borrowers. But it depends entirely on accurate, timely price oracles — a stale or manipulated feed can either liquidate healthy positions or fail to liquidate insolvent ones.