DeFi Lending Guide: How to Calculate Liquidation Risk & Optimize Borrowing Positions
Complete guide to DeFi lending on Aave, Compound, and MakerDAO. Learn to calculate health factors, liquidation prices, and optimize your borrowing positions safely.
DeFi Lending Guide: How to Calculate Liquidation Risk & Optimize Borrowing Positions
Last Updated: December 10, 2025
DeFi lending has revolutionized how we access liquidity and earn yield on crypto assets. With over $20 billion locked in protocols like Aave, Compound, and MakerDAO, understanding how to calculate and manage your lending positions is crucial for success.
This comprehensive guide will teach you everything you need to know about DeFi lending calculations, from health factors to liquidation prices.
Table of Contents
- What is DeFi Lending?
- Key Metrics Explained
- How to Calculate Health Factor
- Understanding Liquidation Risk
- Protocol Comparison
- Risk Management Strategies
- Common Use Cases
- Step-by-Step Examples
What is DeFi Lending? {#what-is-defi-lending}
DeFi (Decentralized Finance) lending protocols allow users to:
- Supply assets to earn interest (lending/supplying)
- Borrow assets against collateral
Unlike traditional finance:
- ✅ Permissionless - Anyone with a wallet can participate
- ✅ Non-custodial - You control your funds
- ✅ Transparent - All transactions on-chain
- ✅ Automated - Smart contracts handle everything
- ✅ Over-collateralized - Must provide collateral worth more than the loan
How It Works
Lending (Supply Side):
- Deposit crypto (ETH, USDC, etc.)
- Receive interest-bearing tokens (aTokens on Aave, cTokens on Compound)
- Earn APY on deposits
- Withdraw anytime (subject to available liquidity)
Borrowing:
- Supply collateral (e.g., 10 ETH worth $35,000)
- Borrow up to max Loan-to-Value ratio (e.g., 75% = $26,250)
- Pay interest on borrowed amount
- Must maintain health factor above 1.0 to avoid liquidation
Key Metrics Explained {#key-metrics-explained}
1. Health Factor (HF)
The health factor is the most critical metric for borrowers. It indicates how safe your position is from liquidation.
Formula:
Health Factor = (Collateral Value × Liquidation Threshold) / Borrowed Value
Interpretation:
- HF > 3.0 - Very safe position
- HF 2.0 - 3.0 - Safe position
- HF 1.5 - 2.0 - Moderate risk
- HF 1.0 - 1.5 - High risk (monitor closely)
- HF < 1.0 - Position is liquidated ⚠️
Example:
- Collateral: 10 ETH at $3,500 = $35,000
- Liquidation Threshold: 80%
- Borrowed: $20,000 USDC
- HF = ($35,000 × 0.80) / $20,000 = 1.40
- Status: High risk - needs monitoring
2. Loan-to-Value (LTV)
LTV determines how much you can borrow against your collateral.
Formula:
LTV = Borrowed Value / Collateral Value × 100%
Typical LTV Ratios:
- Stablecoins (USDC, DAI): 85% - Low volatility
- Blue Chips (ETH, WBTC): 75-80% - Moderate volatility
- Altcoins (LINK, AAVE): 60-70% - Higher volatility
Example:
- Collateral: $35,000
- Borrowed: $20,000
- LTV = $20,000 / $35,000 = 57.14%
3. Liquidation Threshold
The liquidation threshold is the LTV at which your position becomes eligible for liquidation. It's always higher than max LTV to provide a buffer.
Example (ETH on Aave):
- Max LTV: 75%
- Liquidation Threshold: 80%
- Buffer: 5%
This means you can borrow up to 75% of collateral value, but liquidation happens at 80% LTV.
4. Liquidation Price
The collateral price at which your position will be liquidated.
Formula:
Liquidation Price = Borrowed Value / (Collateral Amount × Liquidation Threshold)
Example:
- Collateral: 10 ETH
- Borrowed: $20,000
- Liquidation Threshold: 80%
- Liquidation Price = $20,000 / (10 × 0.80) = $2,500
If ETH drops to $2,500, you get liquidated. Current price is $3,500, so that's a -28.6% drop before liquidation.
5. Liquidation Penalty
When liquidated, you pay a penalty (typically 5-10%) to incentivize liquidators.
Example:
- Collateral value at liquidation: $25,000
- Debt: $20,000
- Liquidation penalty: 5%
- You lose: $20,000 × 1.05 = $21,000 worth of collateral
- You keep: $25,000 - $21,000 = $4,000
How to Calculate Health Factor {#health-factor-calculation}
Let's walk through a complete calculation:
Scenario:
- You deposit 10 ETH as collateral
- ETH price: $3,500
- You borrow 20,000 USDC
- Protocol: Aave V3
- ETH Liquidation Threshold: 80%
Step 1: Calculate Collateral Value
Collateral Value = 10 ETH × $3,500 = $35,000
Step 2: Calculate Borrow Value
Borrow Value = 20,000 USDC × $1 = $20,000
Step 3: Apply Liquidation Threshold
Weighted Collateral = $35,000 × 0.80 = $28,000
Step 4: Calculate Health Factor
Health Factor = $28,000 / $20,000 = 1.40
Result: HF = 1.40 (High Risk ⚠️)
Action Required: Add more collateral or repay debt to reach HF > 2.0 for safety.
Understanding Liquidation Risk {#liquidation-risk}
What Happens During Liquidation?
- Health factor drops below 1.0
- Liquidators repay part/all of your debt
- They receive your collateral + liquidation bonus
- You lose collateral (but debt is cleared)
Real-World Example: The May 2021 Crash
On May 19, 2021, crypto crashed 50% in hours:
User Position Before:
- Collateral: 100 ETH at $4,000 = $400,000
- Borrowed: $250,000 USDC
- LTV: 62.5%
- Health Factor: 2.05 ✅
After Crash (ETH drops to $2,000):
- Collateral: 100 ETH at $2,000 = $200,000
- Borrowed: $250,000 USDC
- LTV: 125% (impossible!)
- Health Factor: 0.64 ⚠️ LIQUIDATED
Result:
- Lost all 100 ETH (worth $200K)
- Debt cleared
- Total loss: $150,000 (initial $400K - $250K debt)
How to Avoid Liquidation
- Maintain high health factor (>2.0)
- Borrow conservatively (50-60% of max LTV)
- Set price alerts for your liquidation price
- Keep reserves to add collateral quickly
- Monitor during volatility
- Use stablecoins as collateral for lower risk
Protocol Comparison {#protocol-comparison}
Aave V3 (Recommended)
Pros:
- ✅ Largest TVL ($10B+)
- ✅ Multi-chain (Ethereum, Polygon, Arbitrum, Base, etc.)
- ✅ Best liquidity
- ✅ E-mode for correlated assets (stablecoins, ETH derivatives)
- ✅ Isolation mode for risky assets
- ✅ Flash loans available
Cons:
- ❌ More complex interface
- ❌ Higher gas costs on Ethereum
Best For: Most users, especially multi-chain
Example Rates (December 2025):
- ETH Supply: 2.5% APY
- ETH Borrow: 3.8% APY
- USDC Supply: 4.2% APY
- USDC Borrow: 5.5% APY
Compound V3
Pros:
- ✅ Battle-tested (since 2018)
- ✅ Simple, clean interface
- ✅ Lower liquidation penalty (8% vs 5%)
- ✅ COMP token rewards
Cons:
- ❌ Ethereum only (V2)
- ❌ Less liquidity than Aave
- ❌ Fewer supported assets
Best For: Ethereum users, beginners
Example Rates:
- ETH Supply: 2.2% APY
- ETH Borrow: 3.5% APY
- USDC Supply: 3.8% APY
- USDC Borrow: 5.2% APY
Spark Protocol (MakerDAO)
Pros:
- ✅ Backed by MakerDAO (DAI issuer)
- ✅ Competitive DAI rates
- ✅ Higher max LTV on some assets
- ✅ Integration with DeFi ecosystem
Cons:
- ❌ Smaller user base
- ❌ Less liquidity
- ❌ Primarily DAI-focused
Best For: DAI users, MakerDAO ecosystem participants
Example Rates:
- ETH Supply: 3.5% APY
- ETH Borrow: 4.0% APY
- DAI Supply: 5.0% APY
- DAI Borrow: 3.5% APY
Risk Management Strategies {#risk-management}
Strategy 1: Conservative Borrowing
Target: Health Factor > 2.5
Approach:
- Borrow only 40-50% of max LTV
- Use stable collateral (USDC, DAI)
- Monitor weekly
Example:
- Deposit: $100,000 USDC
- Max borrow at 85% LTV: $85,000
- Conservative borrow: $42,500 (50% of max)
- Health Factor: 3.4 ✅
Strategy 2: Moderate Risk
Target: Health Factor 1.8-2.2
Approach:
- Borrow 60-70% of max LTV
- Use blue chip collateral (ETH, WBTC)
- Monitor daily during volatility
Example:
- Deposit: 10 ETH at $3,500 = $35,000
- Max borrow at 75% LTV: $26,250
- Moderate borrow: $21,000 (60% of max = 80% LTV)
- Health Factor: 1.90 ⚠️
Strategy 3: Recursive Lending (Advanced)
⚠️ High Risk - Not recommended for beginners
How it works:
- Deposit 10 ETH ($35,000)
- Borrow 7.5 ETH ($26,250) - 75% LTV
- Re-deposit borrowed 7.5 ETH
- Borrow 5.6 ETH more
- Repeat...
Result:
- Effective leverage: 3-4x
- Higher yields but extreme liquidation risk
- Not recommended unless you're experienced
Common Use Cases {#use-cases}
1. Leverage Long Position (Bullish)
Goal: Amplify gains if you're bullish on ETH
Steps:
- Deposit 10 ETH ($35,000)
- Borrow $20,000 USDC
- Buy 5.7 more ETH with USDC
- Now you have 15.7 ETH exposure (vs 10)
Scenario Analysis:
If ETH +20% ($3,500 → $4,200):
- Without leverage: 10 ETH × $4,200 = $42,000 (profit: $7,000)
- With leverage: 15.7 ETH × $4,200 = $65,940 - $20,000 debt = $45,940 (profit: $10,940)
- Extra profit: $3,940 (56% more)
If ETH -20% ($3,500 → $2,800):
- Without leverage: 10 ETH × $2,800 = $28,000 (loss: $7,000)
- With leverage: 15.7 ETH × $2,800 = $43,960 - $20,000 debt = $23,960 (loss: $11,040)
- Extra loss: $4,040 (57% worse)
- Health Factor drops to 1.1 ⚠️ Risk of liquidation!
2. Tax-Efficient Liquidity
Goal: Get cash without triggering capital gains tax
Scenario:
- You bought ETH at $1,000, now worth $3,500
- Need $50,000 for house down payment
- Don't want to sell and pay 20-37% capital gains tax
Solution:
- Supply 15 ETH ($52,500)
- Borrow $40,000 USDC
- Cash out USDC
- Pay ~4% interest ($1,600/year)
- Repay when convenient (or never, just pay interest)
Tax Savings:
- Capital gains on $50K: ~$10,000-$18,500
- Interest cost per year: $1,600
- Net savings: $8,400-$16,900 first year
3. Yield Farming (Market Neutral)
Goal: Earn net positive yield
Setup:
- Deposit stablecoins earning 5% APY
- Borrow assets at 3% APY
- Net yield: 2% APY
Example:
- Supply: $100,000 USDC at 5% APY = $5,000/year
- Borrow: $75,000 ETH at 3% APY = $2,250/year
- Net yield: $2,750/year (2.75%)
Plus potential upside if borrowed ETH appreciates!
4. Short Selling (Bearish)
Goal: Profit from price decline
Steps:
- Deposit $50,000 USDC as collateral
- Borrow 10 ETH at $3,500
- Sell 10 ETH for $35,000 USDC
- Wait for ETH to drop
- Buy back 10 ETH at $3,000 for $30,000
- Repay 10 ETH loan
- Profit: $5,000 (minus interest)
Risk: If ETH goes up, you still owe 10 ETH + interest!
Step-by-Step Examples {#examples}
Example 1: Safe Lending Position
Goal: Earn yield with minimal liquidation risk
Setup:
- Deposit: 20,000 USDC
- Borrow: 8,000 DAI (40% LTV)
- Protocol: Aave V3
Calculations:
- Collateral Value: $20,000
- Borrow Value: $8,000
- LTV: 40%
- Liquidation Threshold (USDC): 90%
- Health Factor: ($20,000 × 0.90) / $8,000 = 2.25 ✅
Annual Costs/Revenue:
- USDC Supply APY: 4.5% = $900/year
- DAI Borrow APY: 3.5% = $280/year
- Net: +$620/year profit 🎉
Liquidation Risk: Virtually zero (stablecoin collateral)
Example 2: Moderate Risk Position
Goal: Get liquidity while maintaining reasonable safety
Setup:
- Deposit: 10 ETH at $3,500 = $35,000
- Borrow: 20,000 USDC (57% LTV)
- Protocol: Aave V3
- Target HF: 2.0
Calculations:
- Collateral Value: $35,000
- Borrow Value: $20,000
- LTV: 57.14%
- Liquidation Threshold (ETH): 80%
- Health Factor: ($35,000 × 0.80) / $20,000 = 1.40 ⚠️
Problem: HF too low!
Solution - Add Collateral:
- Target HF: 2.0
- Required collateral: (2.0 × $20,000) / 0.80 = $50,000
- Need to add: 4.3 ETH ($15,000)
New Position:
- Collateral: 14.3 ETH = $50,000
- Borrow: $20,000
- New HF: 2.0 ✅
Liquidation Price:
- Liq Price = $20,000 / (14.3 × 0.80) = $1,748
- Current: $3,500
- Buffer: -50% before liquidation
Annual Cost:
- ETH Supply: 2.5% on $50K = $1,250
- USDC Borrow: 3.8% on $20K = $760
- Net cost: $760 - $1,250 = +$490 profit
Example 3: High-Risk Leverage
⚠️ Advanced traders only!
Goal: 2x leveraged long on ETH
Setup:
- Deposit: 10 ETH at $3,500 = $35,000
- Borrow: $26,250 USDC (75% LTV = max)
- Buy: 7.5 more ETH
- Total exposure: 17.5 ETH
Calculations:
- Collateral: 17.5 ETH = $61,250
- Debt: $26,250
- Effective leverage: 1.75x
- LTV: 75% (at max!)
- Health Factor: ($35,000 × 0.80) / $26,250 = 1.07 ⚠️⚠️
Liquidation Price:
- Liq Price = $26,250 / (10 × 0.80) = $3,281
- Current: $3,500
- Buffer: Only -6.3% before liquidation! 🚨
Scenario Analysis:
If ETH +10% → $3,850:
- Collateral: 10 ETH × $3,850 = $38,500
- Debt: $26,250
- Profit: $3,500 vs $3,500 unlevered = Same!
- (Need bigger move to profit after interest)
If ETH -7% → $3,255:
- LIQUIDATED! 💀
- Lose most of your ETH
Verdict: Extremely risky. Not recommended.
Using the Calculator
Our DeFi Lending Calculator helps you:
- Calculate health factor instantly
- Find liquidation price for any position
- Compare protocols (Aave, Compound, MakerDAO)
- Simulate price scenarios (-50% to +50%)
- Optimize borrowing for target health factor
- Calculate costs over any timeframe
Example Use:
- Enter your collateral (10 ETH at $3,500)
- Enter borrow amount (20,000 USDC)
- Select protocol (Aave V3)
- Instantly see:
- Health factor: 1.40 ⚠️
- Liquidation price: $2,500
- Daily cost: $1.50
- Risk level: High
- Recommended action: Add collateral
Best Practices Summary
✅ DO:
- Maintain health factor above 2.0
- Set price alerts for liquidation prices
- Start with small positions
- Use stablecoins for low risk
- Monitor positions daily during volatility
- Keep extra funds to add collateral
- Calculate costs before opening positions
❌ DON'T:
- Borrow at max LTV (no buffer)
- Ignore health factor warnings
- Use recursive lending without experience
- Forget about interest costs
- Panic sell during dips (add collateral instead)
- Underestimate volatility risk
Frequently Asked Questions
Q: Can I lose more than my collateral? A: No. DeFi lending is over-collateralized. Worst case is losing collateral to liquidation.
Q: What's a safe health factor? A: 2.0+ is safe. 2.5+ is very safe. 3.0+ is conservative.
Q: How often do rates change? A: Every block (~12 seconds) based on protocol utilization.
Q: Which protocol is best? A: Aave V3 for most users (best liquidity, multi-chain). Compound for simplicity.
Q: Are liquidations instant? A: Yes. Liquidators monitor positions 24/7 with bots.
Q: Can I repay partially? A: Yes. Repaying any amount improves your health factor.
Conclusion
DeFi lending is powerful but requires careful risk management. The most important lesson:
Always maintain a healthy position (HF > 2.0) and never borrow more than 60% of max LTV.
Use our calculator to:
- Simulate positions before opening
- Monitor existing positions
- Calculate optimal strategies
- Compare protocols
Ready to start? Try the calculator: DeFi Lending Calculator →
Related Tools
- Impermanent Loss Calculator - Compare lending vs LP
- Staking Rewards Calculator - Compare staking yields
- Gas Fee Calculator - Estimate transaction costs
- Portfolio Tracker - Track all positions
Disclaimer: This guide is for educational purposes only. DeFi lending involves significant risk. Never invest more than you can afford to lose. Always do your own research. Not financial advice.
Share this article:
Related Articles
Complete Guide to Crypto Bridge Costs: Compare Fees & Find the Cheapest Route
Learn how to compare crypto bridge costs across official and third-party bridges. Compare Arbitrum, Optimism, Hop, Across, and more. Save money on your cross-chain transfers.
Yield Farming Optimizer Guide: Maximize DeFi Returns in 2024
Complete guide to yield farming across 50+ protocols. Learn to calculate returns, compare APYs, manage risk, and optimize your DeFi strategy with auto-compounding.
Uniswap V3 Liquidity Mining Guide: Advanced ROI Simulator & Strategy Calculator
# Uniswap V3 Liquidity Mining Guide: Advanced ROI Simulator & Strategy Calculator Uniswap V3 revolutionized DeFi liquidity provision by introducing concentrated liquidity, allowing LPs to earn 4,000...