Lending and borrowing in DeFi
A DeFi lending service lets you earn interest on tokens you deposit, or borrow against tokens you hold. There is no credit check, because every loan is backed by collateral worth more than the loan. This lesson explains how that works and how borrowers lose money.
Lending into a pool
You deposit a token, such as a stablecoin, into a pool run by a smart contract. Borrowers take tokens from that pool and pay interest. The interest is shared among depositors.
The rate is not fixed. It rises when much of the pool is borrowed and falls when little is. You can usually withdraw at any time, unless nearly everything in the pool is lent out.
Borrowing against collateral
To borrow, you first deposit collateral. You can then borrow other tokens up to a fraction of its value. The loan is always smaller than the collateral, which is why it is called overcollateralised.
People borrow for two main reasons:
- To get stablecoins to spend without selling the crypto they hold
- To buy more crypto with borrowed money, which is leverage
Leverage multiplies gains and losses alike.
The health factor
A lending service tracks each loan with a number. On Aave, a widely used lending service, it is called the health factor:
health factor = (collateral value × liquidation threshold) ÷ amount borrowed
Aave's own example: you deposit $10,000 of ETH with a liquidation threshold of 80% and borrow $6,000 of a stablecoin. The health factor is 10,000 × 0.80 ÷ 6,000 = 1.33.
If the health factor falls below 1, the loan can be liquidated.
Liquidation
Suppose ETH falls 25%. Your collateral is now worth $7,500. The health factor is 7,500 × 0.80 ÷ 6,000 = 1.0. One more tick down and you are below the line.
At that point anyone can step in as a liquidator. They repay part of your debt and take that amount of your collateral, plus a bonus, as their reward. The bonus comes out of your collateral. On Aave, a loan whose health factor is 0.95 or lower can be liquidated in full.
Three things make this harsh:
- It is automatic. Liquidators are bots that act within seconds. Nobody phones you first.
- It happens at the worst time. Collateral is sold when its price has just fallen.
- It can cascade. Forced sales push prices lower, which liquidates more loans. The Bank for International Settlements noted this effect in the crypto sell-off of September 2021.
Crypto has fallen 25% in a few days many times.
Flash loans
DeFi also has loans with no collateral that must be borrowed and repaid inside a single transaction. If the repayment fails, the whole transaction is cancelled as if it never happened. Traders use them for arbitrage, for example buying a token where it is cheap and selling it where it is dear in one step.
If you lend or borrow
- Lending is not a savings account. The contract can fail, and the token you lent can lose its value.
- Borrow far less than the maximum. A health factor just above 1 is one bad day from liquidation.
- Watch the position. The health factor moves with the price of your collateral and of what you borrowed.
- Add collateral or repay early. Both raise the health factor.
- Know the tax position. Lesson 60 covers how unclear the rules for DeFi can be.
Can a DeFi loan be liquidated without anyone contacting the borrower first?
DeFi loans are secured by more collateral than the amount borrowed. When the collateral's price falls far enough, bots sell it automatically, so borrow well below the limit or not at all.
Sources
- Aave: Health factor and liquidations
- ethereum.org: What is DeFi?
- Bank for International Settlements: DeFi risks and the decentralisation illusion
Facts checked against these sources on 10 October 2026.
The course by email
Five short emails to get you started, then one a month about what is new. No price tips and no hype.
Free. Unsubscribe any time. See our privacy notice.
Want your progress saved too? Create a free account.