Module 9: DeFi Deep Dive

Health Factor and Liquidations

Chapter 6 of 14 · about 5 minutes

6.1 How far can ETH fall?

Node's loan from Chapter 5 was simple: 10 ETH as collateral, $15,000 USDC borrowed. Now Node wanted to know exactly how safe it was.

"If ETH crashes, when does the protocol sell my collateral?" asked Node.

"There's a single number that tells you," said Hash. "It's called the health factor. Learn to calculate it, and you'll never be surprised by a DeFi liquidation."

6.2 The health factor

Most lending protocols use a health factor to measure how safe a position is.

Health factor = (collateral value × liquidation threshold) ÷ debt value

Health factorMeaning
Above 2Comfortable buffer
1.5 to 2Moderate buffer
1 to 1.5Getting risky
Below 1Eligible for liquidation

For Node's position:

Value
Collateral10 ETH × $3,000 = $30,000
Liquidation threshold82.5%
Debt$15,000
Health factor($30,000 × 0.825) ÷ $15,000 = 1.65

Chapter 6 · Health factor and liquidation

Health factor equals collateral value times the liquidation threshold divided by debt. A position with a health factor of 1.65 is safe, but as collateral falls toward a liquidation price it approaches one. At that point a liquidator repays up to half the debt and takes the collateral plus a bonus.

A loan's health factor is collateral times its liquidation threshold divided by debt. Above one is safe; at one the position can be liquidated, letting a liquidator repay part of the debt and seize collateral plus a bonus.

6.3 Liquidation price

To find the ETH price at which Node's health factor reaches 1:

Liquidation price = debt ÷ (collateral amount × liquidation threshold)

= $15,000 ÷ (10 × 0.825) = $1,818

ETH priceCollateral valueHealth factor
$3,000$30,0001.65
$2,500$25,0001.38
$2,000$20,0001.10
$1,818$18,1801.00: liquidation threshold
$1,600$16,0000.88: liquidated

ETH would need to fall about 39% from $3,000 for Node's position to be liquidated.

"Thirty-nine percent sounds like a lot," said Node.

"In crypto, it's happened in weeks," said Hash. "Module 1, Chapter 13 showed drawdowns of 75% or more. Your buffer is reasonable, but not unlimited."

6.4 Interest makes debt grow

Debt isn't fixed. Interest accrues continuously, increasing what you owe, and slowly lowering your health factor even if prices don't move.

Value
Debt$15,000
Borrow rate8% a year (illustrative)
Debt after one year, if not repaid~$16,200
New liquidation price, ETH unchanged~$1,964

If borrow rates spike during market stress (Chapter 5), debt grows even faster.

6.5 How liquidation works

When a position's health factor falls below 1, anyone can liquidate it. Typically, liquidators, usually bots (Module 3, Chapter 11), compete to do so because it's profitable.

  1. The liquidator repays part of the borrower's debt, often up to 50%, using their own funds.
  2. In return, they receive the borrower's collateral equal to the repaid amount plus a liquidation bonus.
  3. The borrower's debt and collateral both shrink, and the health factor improves.

Node's liquidation, if ETH fell to $1,800:

StepValue
Debt$15,000
Liquidator repays (50%)$7,500
Liquidation bonus5%
Collateral taken from Node$7,500 × 1.05 = $7,875 of ETH, about 4.38 ETH
Node's remaining collateralAbout 5.62 ETH
Node's remaining debt$7,500

Node's loss from the liquidation itself is the $375 bonus paid to the liquidator. But Node has also effectively sold 4.38 ETH near the bottom of a crash, and lost that exposure if the price recovers.

Unlike centralised exchange liquidations (Module 7, Chapter 8), DeFi liquidations are usually partial and transparent. But they happen automatically, at any hour, with no warning call.

6.6 When liquidations fail: bad debt

Liquidation depends on collateral being worth more than the debt when liquidators act. In extreme conditions, this can fail:

CauseEffect
Price crashes faster than liquidators can actCollateral falls below the debt value
Illiquid collateralLiquidators can't sell the collateral without huge losses, so they don't act
Oracle failure or delayLiquidations are triggered late, or at wrong prices (Module 3, Chapter 12)
Network congestionHigh gas prices make small liquidations unprofitable

When collateral is worth less than the debt, the protocol is left with bad debt. Protocols may cover it with reserves, insurance funds, or a safety module funded by stakers, or the loss may fall on lenders. This is why lenders care about the quality of collateral a protocol accepts (Module 5, Chapter 10).

6.7 Protecting your position

ActionEffect
Borrow conservativelyKeep the health factor well above 1, for example 2 or higher
Monitor regularlySet alerts on health factor or ETH price
Add collateralRaises the health factor
Repay part of the debtRaises the health factor
Use stable or correlated collateralReduces volatility relative to debt
Watch borrow ratesRising rates increase debt faster
Automated protection toolsSome services automatically repay or add collateral when thresholds are hit, adding their own smart contract risk

Node set an alert for a health factor of 1.3, around an ETH price of $2,360, as a signal to add collateral or repay some debt.

"So the plan is to act long before the protocol acts for me," said Node.

"Exactly," said Hash. "Same principle as stops in perps (Module 7, Chapter 14). Liquidation should never be your plan."

6.8 Try it yourself

Using the formulas in sections 6.2 and 6.3, calculate the health factor and liquidation price for a position of 5 ETH collateral and $6,000 borrowed, using a liquidation threshold of 82.5% and today's ETH price. Then calculate how both change if you borrow $3,000 more, or if ETH falls 30%.

Key takeaways from this chapter

  1. The health factor equals collateral value times liquidation threshold, divided by debt; below 1, a position can be liquidated.
  2. The liquidation price can be calculated directly from debt, collateral amount, and threshold.
  3. Interest accrues on debt, slowly reducing the health factor even if prices don't move.
  4. Liquidators repay part of the debt and receive collateral plus a bonus; DeFi liquidations are often partial.
  5. Fast crashes, illiquid collateral, oracle failures, and congestion can create bad debt for protocols.
  6. Borrow conservatively, monitor, set alerts, and add collateral or repay before the protocol liquidates you.