Sub topic 9
Liquidations: protecting the system when collateral falls
Prerequisites and the basic idea
This chapter assumes you understand wallets, token transfers, supply and demand, and the purpose of a stablecoin peg. It also assumes you know that a crypto-backed stablecoin is created against cryptocurrency locked in a smart contract.
A liquidation is the forced sale of collateral when a borrower's position no longer has enough value to safely support its debt. Liquidations protect the stablecoin system from bad debt. Bad debt exists when the collateral is worth less than the tokens that the borrower owes.
Suppose a user locks ETH and receives stablecoins. If ETH falls sharply, the system cannot wait for the user to repay voluntarily. The protocol makes the position repayable by liquidators, who sell some or all of the ETH and use the proceeds to cover the debt.
Collateral ratio and liquidation threshold
The collateral ratio compares the market value of locked collateral with the value of the debt:
collateral ratio = collateral value / debt valueFor example, 10 ETH priced at $3,000 is worth $30,000. If the user has created $10,000 of stablecoins, the collateral ratio is 300%.
A protocol sets a minimum collateral ratio, such as 150%. The position becomes eligible for liquidation when its ratio falls to that level or below.
| Item | Value |
|---|---|
| Collateral | 10 ETH |
| Debt | $10,000 |
| Minimum ratio | 150% |
| Liquidation price | $1,500 per ETH |
The liquidation price can be estimated as:
liquidation price = debt × minimum ratio / collateral amountWith $10,000 of debt, a 150% minimum ratio, and 10 ETH, the price is $1,500. At that price, the collateral is worth $15,000, exactly 150% of the debt. Fees and penalties may cause the practical trigger to differ.
def collateral_ratio(collateral_amount, collateral_price, debt_usd):
return collateral_amount * collateral_price / debt_usd
def liquidation_price(collateral_amount, debt_usd, min_ratio):
return debt_usd * min_ratio / collateral_amount
eth_amount = 10
debt = 10_000
minimum_ratio = 1.5
print(collateral_ratio(eth_amount, 3_000, debt)) # 3.0
print(liquidation_price(eth_amount, debt, minimum_ratio)) # 1500.0How a liquidation works
A price oracle supplies the protocol with an estimate of ETH's market price. When the oracle reports that a position is below its required ratio, the position becomes liquidatable.
A liquidator then repays some or all of the borrower's stablecoin debt. In return, the liquidator receives collateral, usually at a discount. This discount is called a liquidation penalty or liquidation bonus. It pays the liquidator for providing capital and taking price risk.
The process usually follows these steps:
- The oracle updates the collateral price.
- The protocol checks the collateral ratio.
- A liquidator repays eligible debt.
- The protocol transfers or sells enough collateral to cover the debt and penalty.
- Any remaining collateral goes back to the borrower, unless the position is fully closed.
The exact process differs. Some protocols sell collateral directly on a decentralized exchange. Others use an auction in which bidders compete to purchase the collateral.
Why liquidations can fail
Liquidations depend on several systems working at the same time:
- The oracle must report a timely and reliable price.
- Liquidators must have stablecoins and transaction access.
- The collateral must be saleable in a liquid market.
- The blockchain must process transactions quickly enough.
- The liquidation penalty must reward liquidators without being excessive.
If many positions become liquidatable together, selling collateral can push its price down further. This is called liquidation-driven price impact. A protocol may respond with higher collateral requirements, auction mechanisms, debt ceilings, or an insurance fund.
Borrowers reduce their risk by maintaining a ratio well above the minimum, repaying debt, or adding collateral before a liquidation occurs.
Exercise
A user locks 8 ETH, owes $8,000, and the protocol requires a 160% minimum collateral ratio. At what ETH price does liquidation begin, ignoring fees?
Show answer
The liquidation price is $8,000 × 1.60 / 8 = $1,600 per ETH.