All coins
Advanced

DeFi & staking

DeFi lending and liquidations

Lending protocols let you borrow against collateral without a credit check. One ratio, the health factor, decides whether a position stands or is sold.

By Dextape DeskUpdated 5 min read
Four linked blocks alternating between ivory ceramic and lavender glass.Four linked blocks alternating between ivory ceramic and lavender glass.
On this page

What you’ll learn

  • Explain how suppliers, borrowers and liquidators interact in a lending pool
  • Calculate a health factor and the price at which a loan can be liquidated
  • List the risks that sit outside the price of the collateral

A lending protocol is a set of contracts that pools deposits and lends them out. Nobody checks a borrower’s identity or income. Credit risk is managed in two ways instead: the borrower locks up collateral worth more than the debt, and an unsafe loan can be liquidated. Depositors still carry the other risks listed below. This lesson follows one loan through Aave-style liquidation. Other protocols differ: in Compound III the protocol itself absorbs an underwater account and sells the collateral separately. Parameters differ by protocol and by asset, so the percentages below are examples.

Key takeaways

  • Suppliers deposit assets and earn interest. Borrowers post collateral and pay interest.
  • Loans are overcollateralized: the collateral is worth more than the debt.
  • Health factor = collateral value × liquidation threshold ÷ debt. Below 1, the position can be liquidated.
  • Liquidation repays debt by selling collateral at a discount. The borrower bears that discount.

The three roles

Suppliers deposit an asset into its pool and receive interest paid by borrowers. Borrowers deposit collateral, then draw a different asset from another pool. Liquidators are third parties, usually bots, that watch for loans whose collateral no longer covers them. The protocol itself holds no view on anyone’s creditworthiness; it only compares numbers.

Interest that moves

Most rates are variable and set by formula. The key input is the utilization rate: the share of a pool that is currently lent out. When little is borrowed, rates are low. As utilization approaches 100%, the formula raises rates steeply to attract deposits and encourage repayment. A borrowing rate can therefore multiply within hours when demand for an asset jumps, and the debt grows at whatever the rate is at each moment.

Two limits on every asset

Each collateral asset has two settings. The loan-to-value limit is the most you can borrow against it at the start. The liquidation threshold is slightly higher and marks where the loan becomes unsafe. Volatile assets get lower limits than stable ones. The gap between the two is the borrower’s initial margin for error.

Worked example: health factor

You deposit 10 ETH when ETH is $2,000, so the collateral is worth $20,000. Suppose the liquidation threshold for ETH is 80%. You borrow 10,000 USDC.

  • Health factor = $20,000 × 0.80 ÷ $10,000 = 1.6.
  • The loan can be liquidated when the health factor falls below 1, that is when 10 × price × 0.80 is less than $10,000.
  • That happens below an ETH price of $1,250, a fall of 37.5% from $2,000.
  • If you had borrowed $14,000 instead, the health factor would start at 1.14 and the liquidation price would be $1,750, a fall of 12.5%.

Aave’s documentation defines the health factor in this way. Two things lower it over time even if you do nothing: a fall in the collateral’s price and the interest added to the debt. If the borrowed asset is not a stablecoin, a rise in its price lowers the health factor as well.

What liquidation does

In Aave’s model, when the health factor is below 1, a liquidator may repay part or all of the debt and receive collateral of the same value plus a bonus. Continue the example with ETH at $1,200 and a 5% bonus. The collateral is worth $12,000 and the health factor is 0.96. A liquidator repays $5,000 of the USDC debt and receives $5,250 of ETH.

  • Debt after liquidation: $5,000.
  • Collateral after liquidation: $12,000 − $5,250 = $6,750.
  • Health factor: $6,750 × 0.80 ÷ $5,000 = 1.08.
  • Cost to the borrower: the $250 bonus, plus having sold ETH at a low price.

How much of a debt one liquidation may repay is a protocol rule. Aave’s documentation states that up to half can be repaid in some conditions and all of it in others, depending on the health factor and the size of the position. Nobody negotiates a margin call with you. Once the protocol’s conditions are met, the first liquidator to send a valid transaction acts. Those conditions can include pauses and grace periods that differ by protocol version, as Aave’s oracle documentation shows.

Risks beyond the collateral’s price

  • Oracle risk. The protocol learns prices from an oracle. A wrong or manipulated price can trigger liquidations that the wider market would not justify.
  • Contract risk. A bug in the protocol can put deposits at risk regardless of anyone’s health factor.
  • Liquidity risk for suppliers. When a pool is fully lent out, suppliers cannot withdraw until borrowers repay or new deposits arrive.
  • Peg risk. A loan in a stablecoin that loses its peg, or collateral in one, changes the ratio suddenly.
  • Governance. Token holders or administrators can change thresholds and rates for existing positions.
  • Network congestion. In a sharp fall, gas fees rise and a transaction to add collateral may arrive too late.

Looping

Borrowed funds can be swapped for more collateral and deposited again, and the cycle repeated. This is leverage built from loans. It produces the same arithmetic as a leveraged futures position, with a liquidation price that moves closer on each loop, and it adds swap costs and contract risk on every step. Leverage and position sizing sets out the general relationship.

Read a lending position

  • Find the liquidation threshold for your collateral and compute the liquidation price yourself.
  • Compare the distance to that price with the asset’s history on its coin page.
  • Note whether the rate is variable, and what the pool’s utilization is.
  • Check which oracle the protocol uses and who can change its parameters.
  • Look up the protocol’s total value locked, and read it as a size, not a safety rating.

Check your understanding

Three quick questions

01 Collateral is worth $20,000, the liquidation threshold is 80% and the debt is $10,000. What is the health factor?

02 Who pays the liquidation bonus?

03 What usually happens to a borrowing rate as a pool approaches full utilization?

Sources

Finished reading?

Mark it complete to track your progress through the learning paths.