🔄 The Liquidation Process: Step by Step

Understand how liquidators protect lending protocols

🔄 The Liquidation Process

Liquidation happens in precise steps, executed by smart contracts and liquidator bots. Let's walk through exactly how a position gets liquidated.

🎮 Interactive: Live Liquidation Simulation

Adjust ETH price to see how it affects liquidation status:

ETH Price$2,000
$800Liq: $1176$3000
Collateral
10 ETH
$20,000
Borrowed
$10,000
Health Factor
1.50
Status
Safe

🎮 Interactive: Step-by-Step Process

Click through each step of a liquidation:

🔍Step 1: Detection

Liquidation bots continuously monitor all borrow positions across the protocol, checking health factors in real-time.

// Pseudo-code for bot monitoring
for (position in allPositions) {
healthFactor = calculateHF(position)
if (healthFactor < 1.0) {
// Position is liquidatable!
triggerLiquidation(position)
}
}
What They Check
  • • Current collateral price
  • • Outstanding debt amount
  • • Liquidation threshold
  • • Calculated health factor
Frequency
Professional bots check every block (~12 seconds on Ethereum). Some use mempool monitoring for even faster detection.

Partial vs Full Liquidation

🔪

Partial Liquidation

Most protocols (Aave, Compound) only liquidate enough collateral to bring health factor back above 1.0. Borrower keeps remaining collateral.

Example
$20k collateral, $12k debt (HF = 0.9). Liquidate $7k collateral to repay enough debt → HF back to 1.2. Borrower keeps $13k collateral.
💥

Full Liquidation

Some protocols (MakerDAO, older designs) liquidate entire positions. Borrower loses all collateral, though excess value may be returned.

Example
$20k collateral, $12k debt. Entire $20k seized. After repaying debt + penalty, $7k excess returned to borrower (if protocol design allows).