Sub topic 13
Liquidations in DeFi Lending: Health Factor and Liquidation Bonus
Assume you understand collateral, borrowing, long and short positions, and percentages. This chapter uses simple arithmetic and basic Python. DeFi lending protocols add a different liquidation model from perpetual futures: a smart contract checks whether a borrower's collateral still safely covers the debt.
How a lending position becomes unsafe
In a DeFi lending protocol, a borrower deposits collateral such as ETH and borrows another asset such as USDC. The protocol does not usually allow the borrower to borrow the full market value of the collateral. It applies a liquidation threshold.
The liquidation threshold is the maximum share of collateral value that can support debt before liquidation becomes possible. A threshold of 80% means that $10,000 of collateral supports up to $8,000 of debt for the health calculation.
The main measurement is the health factor:
def health_factor(collateral_value, liquidation_threshold, debt_value):
"""Return a DeFi lending position's health factor."""
return collateral_value * liquidation_threshold / debt_value
safe = health_factor(10_000, 0.80, 6_000)
unsafe = health_factor(7_000, 0.80, 6_000)
print(round(safe, 2)) # 1.33
print(round(unsafe, 2)) # 0.93A health factor above 1 is normally safer. At exactly 1, the position reaches the liquidation boundary. Below 1, a liquidator may be allowed to repay some of the borrower's debt and seize collateral.
The value in this formula comes from price oracles. If ETH falls, the collateral value falls even when the number of ETH deposited has not changed. Interest can also increase the debt value over time.
The liquidation bonus
A liquidation bonus is a discount paid to the liquidator in collateral. It compensates the liquidator for supplying repayment capital, transaction costs, price risk, and execution risk.
For example, suppose a protocol sets a 5% bonus. A liquidator repays $1,000 of a borrower's USDC debt. The protocol may let the liquidator claim $1,050 worth of the borrower's ETH. The extra $50 is taken from the borrower's collateral.
The bonus creates an economic reason to monitor unhealthy positions. It also helps the protocol reduce debt before collateral prices fall further. However, a large bonus increases the borrower's loss and can create more selling pressure when the liquidator sells the seized collateral.
| Feature | DeFi lending liquidation | Perpetual futures liquidation |
|---|---|---|
| Trigger | Health factor below the protocol limit | Margin falls below maintenance requirement |
| Liquidator | Usually an external bot or user | Exchange liquidation engine |
| Reward | Discounted collateral, called a bonus | Fees, spread, or liquidation proceeds vary |
| Main risk | Oracle, smart contract, and collateral liquidity risk | Mark price, execution, and insurance-fund risk |
Partial liquidation and bad debt
Protocols often liquidate only part of an unsafe position. Partial liquidation reduces debt and raises the health factor while avoiding an unnecessary sale of all collateral. The exact repayment limit is protocol-specific.
Liquidation does not guarantee that every loan remains fully covered. If collateral falls sharply, or if a token cannot be sold near its quoted price, the collateral may be worth less than the debt. The uncovered amount is bad debt. Protocols may absorb it through reserves, liquidation penalties, governance mechanisms, or losses assigned to depositors.
Practical checks
Before borrowing against volatile collateral, check:
- The liquidation threshold and any loan-to-value limit.
- Whether the protocol liquidates partially or fully.
- The liquidation bonus and the collateral's trading liquidity.
- Which oracle supplies prices and how quickly it updates.
- The distance between the current health factor and 1.
- Whether you have spare collateral or funds to repay debt.
A health factor of 1.05 may look safe, but a small price move or a rise in accrued interest can make it liquidatable. A larger buffer gives the borrower more time to add collateral or repay debt.
Exercise
A borrower has $12,000 of collateral, a 75% liquidation threshold, and $8,000 of debt. What is the health factor, and is the position liquidatable under a health-factor-below-1 rule?
Show answer
The health factor is $12,000 × 0.75 ÷ $8,000 = 1.125. The position is not currently liquidatable, but its buffer is limited.