Lending and Borrowing in DeFi

Crypto lending means depositing assets into a lending market and earning the interest borrowers pay. Borrowers post crypto collateral and can usually borrow less than its value, with automatic liquidation if it falls too far.

On this page 9
  1. How does DeFi lending work?
  2. DeFi lending vs centralized crypto lenders
  3. Why can you only borrow part of your collateral?
  4. What is the health factor? A worked example
  5. How to borrow in DeFi, step by step
  6. How to repay and withdraw collateral
  7. How does liquidation work?
  8. Risks of crypto lending
  9. Sources

Crypto lending means depositing your crypto into a lending market so others can borrow it, and earning interest in return. In DeFi, these markets are run by smart contract protocols such as Aave and Compound. Borrowers don’t provide ID or proof of income; they post crypto as collateral and can usually borrow less than that collateral is worth.

So there are two sides. Suppliers (lenders) earn a variable interest rate. Borrowers pay interest and must keep their collateral above a safe level, because if its value falls too far, the position is liquidated automatically.

How does DeFi lending work?

Lenders deposit assets, such as USDC, into the protocol’s pool. In return they receive a token representing their deposit plus accrued interest; on Aave these are called “aTokens,” and their balance grows over time. Borrowers draw from the same pool against the collateral they’ve deposited.

Rates aren’t fixed. They adjust automatically with the pool’s utilization: when most of the pool is borrowed, rates rise. That makes new borrowing more expensive and encourages more deposits. The APY you see on screen is therefore an annualized snapshot of current conditions, not a locked-in return for the year.

DeFi lending vs centralized crypto lenders

Some centralized companies also take customer crypto and promise to pay interest on it. Your assets are then under the company’s control, and your return depends on what the company does with them. The 2022 collapse of large centralized lenders such as Celsius, which froze withdrawals and went bankrupt, showed how risky that model can be.

In DeFi protocols, deposits, loans and collateral are visible on-chain to everyone, and the rules are enforced by contract code. That brings transparency, but it doesn’t remove DeFi’s own risks, such as smart contract bugs and oracle failures.

Why can you only borrow part of your collateral?

With no credit scores in DeFi, loans are overcollateralized. Each collateral asset has two key ratios:

  • Maximum LTV (loan-to-value): the most you can borrow against your collateral. With $10,000 of ETH and a 70% LTV, you can borrow up to $7,000.
  • Liquidation threshold: the debt-to-collateral level at which the position can be liquidated. In the same example it might be 80%.

The gap between the two gives you a buffer against small price moves, but borrowing close to the maximum leaves very little room. The ratios vary by asset and protocol, so check the exact values in the protocol’s interface.

What is the health factor? A worked example

On protocols like Aave, the health factor shows how far your position is from liquidation. For a simple single-collateral position it’s collateral value × liquidation threshold ÷ total debt. Below 1, the position can be liquidated.

  • $10,000 collateral, 80% threshold, $5,000 debt: 10,000 × 0.8 ÷ 5,000 = 1.6
  • If the collateral falls to $7,000: 7,000 × 0.8 ÷ 5,000 = 1.12
  • If the collateral falls to $6,250: 6,250 × 0.8 ÷ 5,000 = 1.0 (liquidation line)

In this example, liquidation starts after a drop of about 37.5% in the collateral’s value. And because interest keeps adding to the debt, the health factor slowly drifts lower even if prices stand still.

How to borrow in DeFi, step by step

  1. Open the protocol’s official app and choose the right network and market. Rates and collateral rules can differ across a protocol’s deployments.
  2. Approve the asset you’ll use as collateral and sign the deposit.
  3. Check that the deposited asset is enabled as collateral.
  4. Choose the asset and amount to borrow. Before confirming, look at the new health factor and interest rate, and size the loan so the health factor stays comfortable.
  5. Keep some gas token in your wallet afterwards; you’ll need it to add collateral or repay in a hurry.

What you borrow matters. Borrowing 1 ETH is not a fixed dollar debt: if ETH rises, the dollar value of what you owe rises with it and your health factor falls.

How to repay and withdraw collateral

You repay in the asset you borrowed. If you owe USDC, having ETH in your wallet doesn’t settle the loan; you need USDC first. The repayment includes accrued interest, and the debt grows slightly every block, so using the app’s “repay max” option avoids leaving dust behind.

Once the debt is fully repaid, you can withdraw your collateral. Withdrawing part of it while the loan is open lowers your health factor, and the protocol will block withdrawals that go too far. On the lending side, if utilization is very high, you may not be able to withdraw your full deposit at once.

How does liquidation work?

When the health factor drops below 1, participants called liquidators repay part of your debt and receive some of your collateral at a discount. That discount, the liquidation bonus, comes out of your pocket. It isn’t a voluntary sale at a price you chose. Our leverage and liquidation guide covers the mechanics in more depth.

Ways to avoid liquidation:

  • Borrow with a comfortable health factor, not near the maximum.
  • Be more conservative when your collateral is a volatile asset.
  • Add collateral or repay part of the loan when markets move sharply.
  • Remember that the oracle price the protocol uses can briefly differ from exchange prices.

Risks of crypto lending

  • Smart contract risk: a bug in the protocol could lead to lost funds.
  • Bad debt: if collateral prices crash too fast, liquidations may not cover the loans and the shortfall can hit the pool.
  • Liquidity risk: at high utilization, you may not be able to withdraw when you want.
  • Stablecoin risk: a stablecoin you supply or borrow can lose its peg.

Sources

Read next