🔧 How Lending Protocols Work

Understand liquidity pools, collateral factors, and smart contract logic

⚙️ How Lending Protocols Work

DeFi lending protocols use smart contracts to automate the entire lending and borrowing process. Let's see how a loan actually works step by step.

🎮 Interactive: Borrowing Simulation

Follow the process of taking out a crypto loan with live calculations:

💎 Step 1: Deposit Collateral

First, you must deposit collateral to secure your loan. Adjust the amount to see how it affects your borrowing power:

ETH Amount10 ETH
ETH Price$2,000
Collateral Value
$20,000
10 ETH × $2000
Max Borrowing Power
$15,000
75% of collateral value

Note: Most protocols require 150-200% collateralization. You can borrow up to 50-75% of your collateral value.

Smart Contract Flow

1

User Deposits Collateral

Smart contract locks collateral and issues receipt tokens (e.g., aTokens)

2

Protocol Calculates Borrowing Power

Oracle provides real-time price data; system computes max borrow amount based on LTV ratios

3

User Borrows Assets

Smart contract transfers borrowed assets to user's wallet; debt position is recorded

4

Interest Accrues Continuously

Every block, interest is calculated and added to debt (compounded per second on most protocols)

5

Monitoring & Liquidation

Liquidation bots constantly monitor positions; if HF <1.0, they trigger liquidation to protect lenders