Introduction
Every DeFi activity covered in the last lesson, trading and providing liquidity, assumed you already owned the asset you were working with. Lending markets change that: they let you borrow assets you don't own, or earn interest by supplying assets you do own, all without a bank running a credit check.
This lesson explains how collateral replaces that credit check, how loan to value (LTV) sets your safety margin, how interest rate models adjust automatically with supply and demand, and what actually happens, step by step, when a position gets liquidated.
By the end of this lesson you will understand why lending protocols require over collateralization, how to read a health factor, what a flash loan actually is, and the specific risks that come with borrowing or supplying on chain.
Collateral
Collateral is an asset you lock in a lending protocol's smart contract to secure a loan. Instead of a credit check, the protocol relies entirely on the value of what you've locked up: if you stop repaying, the protocol can seize and sell your collateral to cover the debt.
Because crypto asset prices can move quickly, most lending protocols require over collateralization: the collateral you post is worth more than the amount you borrow, giving the protocol a buffer before a price drop puts the loan at risk.
Loan to Value (LTV)
Loan to value, or LTV, is the ratio between how much you've borrowed and the value of the collateral backing it. A lower LTV means a bigger safety buffer; a higher LTV means less room before the position becomes unsafe.
Every asset a protocol accepts as collateral has a maximum LTV it allows, set according to how volatile and liquid that asset is. More volatile assets get a lower maximum LTV, since their price can move against a position faster.
The gap between your current LTV and the maximum allowed is exactly what the health factor measures, covered later in this lesson.
Interest Rate Models
Interest rate models are the formulas a lending protocol uses to set borrowing and supplying rates automatically, based on how much of the pool's assets are currently borrowed.
As utilization rises (more of the pool is borrowed out), rates increase for both borrowers and suppliers, encouraging new supply and discouraging further borrowing. As utilization falls, rates drop again.
Because rates update in real time, the same lending market can offer very different terms from one week to the next.
Supplying and Borrowing
Supplying means depositing an asset into a lending pool to earn interest; borrowing means taking assets out of that same pool against collateral you've posted. Most participants do both at once: supplying one asset as collateral while borrowing another against it.
- Supplying. Deposit an asset, receive a token representing your deposit plus accrued interest.
- Borrowing. Post collateral, then withdraw a different asset up to your allowed LTV.
- Repaying. Return the borrowed asset plus interest to reclaim your collateral in full.
Nothing stops you from supplying and borrowing the same asset in different markets, though most people borrow something other than what they've posted as collateral.
Health Factor
The health factor is a single live number summarizing how close a borrowing position is to liquidation. It's calculated from your collateral value, your borrowed amount, and the maximum LTV your collateral allows.
A health factor above 1 means the position is safe; a health factor at or below 1 means the collateral is no longer sufficient, and the position becomes eligible for liquidation.
A falling health factor is the clearest warning sign a borrower has that a position needs attention, before a liquidation happens automatically.
Liquidations
A liquidation is the forced sale of a borrower's collateral, triggered automatically once their health factor drops to or below 1. Liquidations happen through smart contracts, without a court process or a phone call.
Liquidators, often automated bots, repay part of a borrower's debt and receive a portion of their collateral in return, usually at a discount as an incentive to act quickly.
Liquidation discounts exist so liquidators are incentivized to act the moment a position becomes unsafe, protecting the protocol's solvency.
Flash Loans
A flash loan lets you borrow any amount from a lending pool with no collateral at all, as long as you repay it, plus a fee, within the same transaction. If the loan isn't repaid before the transaction ends, the entire transaction is reversed as if it never happened.
This makes flash loans useful for tasks that need a large, temporary amount of capital: refinancing a position across protocols, or correcting a price difference between two markets, all inside a single atomic transaction.
Flash loans have also been used to manipulate prices within a single transaction, which is one reason many protocols design carefully around them.
Lending Risks
Lending on chain removes a bank from the process, but it introduces its own specific set of risks.
- Liquidation risk. A price move against your collateral can trigger a liquidation faster than you can react.
- Smart contract risk. A bug in the protocol's code can put deposited or borrowed funds at risk.
- Oracle risk. Lending protocols rely on price feeds to value collateral; a manipulated feed can trigger unfair liquidations.
- Interest rate risk. Rates can rise sharply during high utilization, increasing your borrowing cost with little warning.
- Bad debt risk. If collateral value falls faster than liquidators can act, a protocol can end up with debt that isn't fully covered by collateral.
Summary
Lending protocols replace a bank's credit check with collateral, letting anyone borrow against assets they've locked up or earn interest by supplying assets to a shared pool. Interest rate models adjust automatically as utilization rises and falls.
A position's health factor tracks how close it is to liquidation, which happens automatically once collateral no longer sufficiently covers a loan. Flash loans push this model to its logical extreme: borrowing with no collateral at all, as long as repayment happens in the same transaction.
Glossary
- Lending Protocol
- A smart contract system that lets users supply assets to earn interest or borrow assets against collateral.
- Collateral
- An asset locked up to secure a loan, which can be seized if the loan isn't repaid.
- LTV
- Loan to Value: the ratio between what you've borrowed and the value of your collateral.
- Interest Rate Model
- The formula a lending protocol uses to set borrowing and supply rates based on utilization.
- Utilization
- The share of a lending pool's assets that are currently borrowed out.
- Health Factor
- A live score representing how close a borrowing position is to liquidation.
- Liquidation
- The forced sale of collateral when a loan's safety margin falls too low.
- Liquidator
- A participant, often an automated bot, who repays part of an unsafe loan in exchange for discounted collateral.
- Flash Loan
- An uncollateralized loan that must be borrowed and repaid within a single transaction.
- Bad Debt
- Debt that remains after a liquidation fails to fully cover it with the collateral seized.
Quiz
Check your understanding of this lesson before moving on. Incorrect answers point you straight back to the relevant section.
1. Why don't lending protocols run a credit check?
Correct, well done.
Not quite, review Collateral and try again.
2. What does a lower LTV give a borrower?
Correct, well done.
Not quite, review Loan to Value and try again.
3. What happens to interest rates as a lending pool's utilization rises?
Correct, well done.
Not quite, review Interest Rate Models and try again.
4. What does supplying an asset to a lending pool let you do?
Correct, well done.
Not quite, review Supplying and Borrowing and try again.
5. What does a health factor at or below 1 mean?
Correct, well done.
Not quite, review Health Factor and try again.
6. Who can trigger a liquidation, and what do they receive?
Correct, well done.
Not quite, review Liquidations and try again.
7. What makes a flash loan different from a normal loan?
Correct, well done.
Not quite, review Flash Loans and try again.
8. What is "bad debt" in a lending protocol?
Correct, well done.
Not quite, review Lending Risks and try again.
9. Why does oracle risk matter to a lending protocol?
Correct, well done.
Not quite, review Lending Risks and try again.
You scored 0 out of 9 correct.