How do lending protocols like Aave or Compound work?
Okay, no problem. This question is actually a cornerstone for entering the world of DeFi (Decentralized Finance). Let me explain it to you in plain language.
Imagine it as a "decentralized bank" on the blockchain
You can simply think of protocols like Aave or Compound as fully automated, 24/7, ownerless, staffless "banks" operating on the Ethereum blockchain.
This "bank" primarily does two things:
- Accepts deposits (allowing people to put their idle money in to earn interest)
- Issues loans (allowing people to borrow money by collateralizing assets)
But the biggest difference from traditional banks is that all of this is automatically executed by smart contracts (code written on the blockchain), without human intervention, and with rules that are publicly transparent.
Core Operation: A Huge "Fund Pool"
Traditional lending is "John lends to Jane," a one-on-one arrangement. Aave and Compound are different; they use a "fund pool" model.
You can imagine a huge, transparent money box, which we call a Liquidity Pool.
- People who want to earn money (depositors): Put their cryptocurrencies (e.g., stablecoins like USDC, ETH, etc.) into this money box.
- People who want to borrow money (borrowers): Take money out of this money box to use.
You don't borrow from a specific person, but from the entire pool. Similarly, the interest you earn isn't paid by a particular borrower, but by the entire pool according to its rules.
How do the two key roles participate?
1. Depositor (or "Liquidity Provider")
Your Goal: To generate returns on your idle cryptocurrencies.
Process:
You deposit 1000 USDC into Aave's USDC liquidity pool. Once deposited, the smart contract immediately gives you a "deposit receipt," which is called aUSDC
in Aave.
This aUSDC
is very important; it represents your share in the pool. Over time, borrowers in the pool pay interest, and this interest continuously accumulates in the pool, so the amount of USDC corresponding to your aUSDC
will slowly increase. When you want to withdraw your deposit in the future, you return the aUSDC
to the protocol, and the protocol will return more USDC than you initially deposited (principal + interest) based on the latest exchange rate.
In short: Deposit money, receive a "value-appreciating" token.
2. Borrower
Your Goal: You urgently need money but don't want to sell your held cryptocurrencies (e.g., you're bullish on ETH long-term and don't want to sell it prematurely).
Process: To borrow money in the DeFi world, you first need to "collateralize" something. Because the blockchain doesn't know you and there's no credit score, you must use assets as collateral. Furthermore, this collateral is overcollateralized.
For example:
- Collateralize: You deposit $1000 worth of ETH into Aave as collateral.
- Borrow: Based on the ETH's loan-to-value (LTV) ratio (e.g., 80%), you can borrow up to $800 worth of other assets from the pool, such as 800 USDC.
- Use: You can use these 800 USDC however you wish. Your $1000 worth of ETH still belongs to you; it's just temporarily locked in the protocol as security.
In short: You must collateralize assets to borrow, and the value of the collateral must be higher than the amount borrowed.
Answers to Several Core Questions
How are interest rates determined? An Automated Supply and Demand Market
Interest rates are not fixed; they are dynamically adjusted by an algorithm based on the pool's utilization rate.
- Utilization Rate = (Money Borrowed) / (Total Money in the Pool)
The logic is simple:
- Plenty of money in the pool, few borrowers -> Low utilization rate -> Lower interest rates (to encourage more borrowing).
- Money in the pool is almost fully borrowed -> High utilization rate -> Interest rates skyrocket (to discourage further borrowing and attract more deposits).
All of this is calculated in real-time by smart contracts, making it very responsive.
The Most Important Concept: Collateral and Liquidation
This is the core risk in DeFi lending and a critical mechanism for protecting depositors' funds.
Let's continue with our example: You collateralized $1000 worth of ETH and borrowed $800 worth of USDC.
What if the price of ETH drops? Suppose the price of ETH plummets, and your collateralized ETH is now only worth $850. At this point, the value of your collateral ($850) is very close to your debt ($800), and the system will deem this loan "unhealthy."
To prevent your collateral value from falling below your debt (which would create bad debt for depositors), the protocol triggers a liquidation mechanism.
How does liquidation happen?
- The system allows anyone (whom we call a "liquidator") to repay part or all of your debt for you (e.g., repaying 800 USDC on your behalf).
- In return, this liquidator can take some of your collateralized ETH at a discount (e.g., 10% off). They will take approximately $880 worth of ETH (800 / 0.9), and the remaining ETH is returned to you.
- For you, your debt is repaid, but your collateral has been sold at a discount, and you incur a loss.
- For depositors, their money is safely returned to the pool, and their funds are not harmed.
Therefore, when engaging in DeFi lending, it's crucial to constantly monitor your collateral health to avoid liquidation.
Summary of Aave/Compound Features
- Automated and Decentralized: Code-driven, no manual approval, operates 24/7.
- Transparent: All rules, interest rate models, and fund flows are publicly verifiable on the blockchain.
- Permissionless: Anyone with a crypto wallet can participate, without geographical or identity restrictions.
- Highly Efficient: Deposits and withdrawals are almost instantaneous.
I hope this explanation helps you understand. It's like a transparent and efficient global financial Lego built with code, but remember, high returns also come with high risks like "liquidation."