MODULE 06

Lending

On chain lending markets that replace a bank's credit check with collateral, and pay interest that adjusts automatically as supply and demand shift.

Intermediate Difficulty
40 min Duration
Reading + Quiz Format
12 Sections
Asset ETH
LTV 75%
Health 1.8
01. Introduction

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.

02. Collateral

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.

No credit check

Approval depends only on the value of the collateral you lock, not your history.

Over collateralized

You typically lock more value than you borrow, to absorb price swings.

Seizable

Unpaid collateral can be automatically sold by the protocol, without a court process.

03. Loan to Value (LTV)

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.

position_overview.json
Collateral 2 ETH ($6,000)
Borrowed 3,000 USDC
LTV 50%
Max LTV 75%

The gap between your current LTV and the maximum allowed is exactly what the health factor measures, covered later in this lesson.

04. Interest Rate Models

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.

Borrow Rate

What borrowers pay, rising as utilization increases toward full utilization.

Supply Rate

What suppliers earn, funded directly by the interest borrowers pay.

Because rates update in real time, the same lending market can offer very different terms from one week to the next.

05. Supplying and Borrowing

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.

06. Health Factor

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.

Above 1

Position is safe. The higher the number, the larger the price drop needed before liquidation.

At or below 1

Position is eligible for liquidation. Anyone can trigger it and claim part of the collateral.

A falling health factor is the clearest warning sign a borrower has that a position needs attention, before a liquidation happens automatically.

07. Liquidations

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_event.json
Trigger Health factor at or below 1
Liquidator Repays Part of borrower's debt
Liquidator Receives Collateral, plus a discount bonus
Borrower Keeps Remaining collateral, minus the amount liquidated

Liquidation discounts exist so liquidators are incentivized to act the moment a position becomes unsafe, protecting the protocol's solvency.

08. Flash Loans

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.

No collateral required

The loan only exists within one transaction, so there's no time for the price to move against it.

All or nothing

If repayment fails at any point, the whole transaction reverts, and the loan never happened.

Flash loans have also been used to manipulate prices within a single transaction, which is one reason many protocols design carefully around them.

09. Lending Risks

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.
10. Summary

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.

11. Glossary

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.
12. Quiz

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?

2. What does a lower LTV give a borrower?

3. What happens to interest rates as a lending pool's utilization rises?

4. What does supplying an asset to a lending pool let you do?

5. What does a health factor at or below 1 mean?

6. Who can trigger a liquidation, and what do they receive?

7. What makes a flash loan different from a normal loan?

8. What is "bad debt" in a lending protocol?

9. Why does oracle risk matter to a lending protocol?