DeFi protocols and their risks · Lesson 3 of 5
Lending, borrowing and liquidations
7 min read
Lending protocols are the balance sheet of DeFi: they hold more deposits than any other category and supply the leverage behind much of the rest. Their safety rests on a few parameters, an oracle and a population of liquidators, so a professional who understands health factors, interest-rate curves and bad debt can judge whether a lending market is sound or fragile.
How pool-based lending works
Protocols such as Aave, Compound and Morpho pool deposits instead of matching individual lenders and borrowers. Suppliers deposit an asset and receive an interest-bearing receipt token whose claim grows as borrowers pay interest. Borrowers deposit collateral and draw other assets from the pool.
There is no credit check, no identity and no legal recourse against a borrower who walks away. The only protection is collateral, so every loan is over-collateralized: the borrower must lock more value than they borrow, and the protocol sells the collateral if its value falls too far. This makes DeFi lending closer to a margin loan or repo than to a bank loan.
Market structure matters for contagion. In a shared pool, every supplier of an asset is exposed to every collateral type the pool accepts, so one bad collateral asset can hurt all lenders. Isolated markets (one collateral asset and one loan asset per market, as in Morpho's design) contain losses to the lenders who chose that pair, at the cost of thinner liquidity in each market. Either way, the supplier's receipt token can itself be reused elsewhere as collateral, extending the chain of dependencies described in DeFi building blocks.
LTV, liquidation threshold and health factor
Each collateral asset has risk parameters set by governance:
| Parameter | What it controls | Illustrative value for ETH |
|---|---|---|
| Maximum loan-to-value (LTV) | How much can be borrowed when opening or increasing a loan | 80% |
| Liquidation threshold | The collateral-value ratio at which a position becomes liquidatable | 82.5% |
| Liquidation bonus | The discount at which liquidators buy collateral | 5% |
| Close factor | The share of the debt a liquidator may repay in one go | 50% |
| Supply and borrow caps | Maximum total exposure to the asset | Set per market |
| Reserve factor | The share of interest kept by the protocol's reserve | 10% |
The health factor (HF) combines them:
HF = (collateral value × liquidation threshold) ÷ debt value
A position with HF above 1 is safe; below 1 it can be liquidated.
Worked example. A borrower deposits 10 ETH at $3,000 (collateral $30,000) and borrows 18,000 USDC.
- Maximum borrowing: $30,000 × 80% = $24,000, so $18,000 is allowed.
- Health factor: ($30,000 × 0.825) ÷ $18,000 = $24,750 ÷ $18,000 = 1.375.
- Liquidation price: HF reaches 1 when 10 × P × 0.825 = 18,000, so P = $2,181.82, a fall of about 27%.
The gap between maximum LTV and the liquidation threshold is a buffer, so a newly opened loan is not liquidatable at once. Borrowers who loop (borrow, buy more collateral, redeposit) push their HF close to 1 and their liquidation price close to the market.
Liquidation mechanics
Suppose ETH falls to $2,100. Collateral is now $21,000 and HF = ($21,000 × 0.825) ÷ $18,000 = 0.9625. Anyone may now act as liquidator: usually automated bots that watch every position.
With a 50% close factor, the liquidator repays 9,000 USDC of debt and receives collateral worth $9,000 × 1.05 = $9,450, which is 9,450 ÷ 2,100 = 4.5 ETH. After the liquidation:
- Debt: 9,000 USDC.
- Collateral: 5.5 ETH × $2,100 = $11,550.
- New HF: ($11,550 × 0.825) ÷ $9,000 ≈ 1.06.
The borrower keeps the 9,000 USDC already borrowed but has lost 4.5 ETH, including the $450 bonus, which is the liquidation penalty. The liquidator earns the bonus minus gas and any trading cost of selling the ETH. Some protocols use auctions instead of a fixed bonus (MakerDAO, now Sky, is the best-known example), but the economics are the same: liquidation must be profitable, or nobody will do it.
Interest-rate curves and liquidity risk
Rates are set by an algorithm based on utilization, the share of supplied assets that is currently borrowed:
U = total borrowed ÷ total supplied
Most protocols use a "kinked" curve: rates rise slowly up to an optimal utilization and steeply above it, to attract new deposits and push borrowers to repay. With an illustrative curve of 0% base rate, a slope of 4% up to 90% utilization and a slope of 60% above it:
| Utilization | Borrow rate | Supply rate (10% reserve factor) |
|---|---|---|
| 50% | 4% × 50/90 = 2.2% | 2.2% × 0.50 × 0.90 = 1.0% |
| 90% (the kink) | 4.0% | 4.0% × 0.90 × 0.90 = 3.2% |
| 95% | 4% + 60% × 5/10 = 34% | 34% × 0.95 × 0.90 = 29.1% |
Suppliers earn less than borrowers pay because only part of the pool is lent and the protocol keeps the reserve factor.
The curve hides a liquidity risk that many depositors miss: suppliers can withdraw only what is not lent out. At 100% utilization, withdrawals stop until borrowers repay or new deposits arrive. This happened in April 2026, when depositors rushed out of Aave after the Kelp DAO exploit and some stablecoin pools were fully utilized for a time. A lending deposit is not a demand deposit.
Oracle dependence
Every number above depends on the oracle price. If the oracle reports too high a price for collateral, borrowers can take out more than the collateral is worth; if it reports too low a price, healthy positions are liquidated.
The textbook manipulation case is Mango Markets in October 2022. A trader pushed up the price of the thinly traded MNGO token on the venues the oracle read, then borrowed about $110 million against the inflated collateral. US criminal convictions in that case were vacated by the trial judge in May 2025, which shows how unsettled the legal treatment of "code is law" exploits still is, but the risk lesson is clear: collateral priced from thin markets can be manufactured.
Protocols also have to choose how to price derivative tokens. Pricing a liquid staking token by its exchange rate with the underlying avoids liquidations during temporary market discounts, but ignores real losses if the token is impaired; pricing it by market price is more honest but can trigger liquidation cascades on a brief depeg.
Flash loans
A flash loan is an uncollateralized loan that must be borrowed and repaid within the same transaction, plus a small fee. If it is not repaid, the whole transaction reverts as if it never happened, so the lender takes no credit risk. Legitimate uses include arbitrage, refinancing a loan from one protocol to another and self-liquidation.
Flash loans also give an attacker millions of dollars of capital for one block. They are rarely the vulnerability; they remove the capital constraint that would otherwise make an exploit impractical. In the Euler Finance attack of 13 March 2023, an attacker used flash-loaned funds and a flaw in a donation function to drain about $197 million; most of it was later returned. Protocols must assume that any attacker can borrow the entire liquidity of the market for a single transaction.
Bad debt
Bad debt arises when a position's collateral is worth less than its debt and no one will liquidate it. Causes include prices gapping faster than liquidators can act, collateral too illiquid to sell at the oracle price, oracle delays, network congestion and, increasingly, collateral that is itself compromised.
The April 2026 Kelp DAO case shows the last cause. After stealing about 116,500 rsETH (a liquid restaking token) through a bridge exploit, the attacker deposited much of it into Aave V3 and borrowed WETH against it, leaving positions with very low health factors. Aave froze rsETH markets within hours, and its own early modeling put the resulting bad debt at between about $124 million and $230 million, depending on how the loss would be allocated among rsETH holders on different chains.
Protocols defend against bad debt with conservative parameters for risky collateral, supply caps, isolation modes that limit what risky collateral can borrow, reserves and a staking backstop (Aave's Umbrella module, for example) that is slashed to cover deficits. When these are exhausted, losses fall on suppliers through a haircut or on token holders through dilution. A professional should ask which comes first.
Exam focus: why DeFi loans are over-collateralized; the difference between maximum LTV and liquidation threshold; how to calculate a health factor and a liquidation price; how a liquidation works, including close factor, bonus and the borrower's penalty; utilization-based kinked rate curves and why suppliers cannot always withdraw; oracle dependence and manipulation (Mango Markets, October 2022); what flash loans are and why they amplify exploits (Euler, March 2023); and how bad debt arises and who absorbs it (Kelp DAO and Aave, April 2026).