Part 4 · Chapter 1

Introduction to DeFi

At a Glance

DeFi recreates financial services with smart contracts instead of intermediaries. You'll learn the main categories, metrics, and risks to start safely.

Protocol CategoriesComposabilityTVL & APYRisk Management

Who Is This For?

  • Beginners entering DeFi for the first time
  • Crypto users curious about lending, trading, and yield without banks

Learning Objectives

  1. 01Define DeFi and list core protocol categories
  2. 02Interpret basic DeFi metrics like TVL and APY
  3. 03Identify key risks including smart contract and liquidation risk
Section 1

What DeFi Covers

DeFi — Decentralized Finance — replaces banks, brokers, and exchanges with open-source smart contracts. Anyone with a wallet can access it.

Traditional Finance

  • Banks hold your money
  • KYC / ID required
  • Business hours, days to settle
  • Opaque fees and reserves
  • Geographically restricted

DeFi

  • Smart contracts hold funds
  • Just a wallet needed
  • 24/7, seconds to settle
  • Transparent on-chain data
  • Global, permissionless access

🏗️ Explore Protocol Categories

🏦
Lending & Borrowing

Earn interest or borrow against collateral

Supply crypto to a pool and earn interest from borrowers. Or deposit collateral to borrow other assets without selling your holdings.

How It Works:

Lenders deposit tokens into a smart contract pool. Borrowers post collateral (often 150%+ of loan value) and borrow from that pool. Interest rates adjust algorithmically based on supply and demand.

Key Protocols:
Aave
Multi-chain lending, flash loans, variable/stable rates
Compound
Pioneer of algorithmic lending on Ethereum
MakerDAO
Borrow DAI stablecoin against crypto collateral
You Do
Deposit ETH → Earn 2-5% APY from borrowers
You Earn
Interest from borrowers paid to lenders
Key Risk
Liquidation if collateral value drops below threshold
Section 2

How DeFi Works

Three pillars make DeFi different from traditional finance: smart contracts, composability, and transparency.

📜

Smart Contracts

Code replaces intermediaries. Custody, interest rates, and trade execution are all automated.

🧱

Composability

Protocols can plug into each other like Lego blocks. LP tokens become collateral, borrowed assets become liquidity.

👁️

Transparency

All reserves, rates, and transactions are visible on-chain. Anyone can audit a protocol's real-time state.

🧱 Composability in Action (“DeFi Legos”)

See how protocols stack to create complex strategies:

Step 1: Deposit into a Lending Protocol

You deposit 10 ETH into Aave as collateral.

Layer 1: AaveDeposit 10 ETH
Receive aETH (receipt token)
Key Insight:

Your aETH is a token that represents your deposit. It earns interest and can be used elsewhere.

Step 1 of 4
Section 3

Metrics & Getting Started

Understanding key metrics helps you evaluate protocols and estimate real returns.

TVL

Total Value Locked

The total $ value of assets deposited in a protocol. Higher TVL generally signals more adoption and trust.

APY

Annual Percentage Yield

Your projected yearly return with compounding. APR is without compounding. APY is always higher than APR.

Volume

Trading / Protocol Volume

How much value flows through the protocol daily. Higher volume means more fees for LPs.

💰 Real Yield Calculator

See what you'd actually earn after gas costs:

Gross Yield / Year
$50.00
Gas Cost / Year
$96.00
Net Yield / Year
$-46.00
Effective APY
-4.60%

🚨 You're losing money! Gas costs exceed your yield. Consider a larger deposit, an L2 with cheaper gas, or fewer transactions.

🚀 Getting Started Safely
1.Start with small amounts you can afford to lose entirely
2.Use established protocols (Aave, Uniswap, Compound) with long track records
3.Read the docs and check for audits before depositing
4.Consider L2s (Arbitrum, Base, Optimism) for lower gas fees
5.Use DeFiLlama to research TVL, yields, and protocol health
Know the Risks

DeFi Risk Map

Every DeFi opportunity comes with risk. Understanding them is essential before depositing anything.

🐛
Smart Contract Risk
high

Bugs in protocol code can be exploited to drain funds. Even audited contracts have been hacked.

Example: The Euler Finance hack ($197M, 2023) exploited a vulnerability in their donation function.
Mitigation: Use battle-tested protocols with multiple audits, bug bounties, and long track records.
💥
Liquidation Risk
high

When borrowing, if your collateral value drops below the required ratio, it gets automatically sold (liquidated).

Example: You borrow $5,000 against $10,000 ETH. ETH drops 55% → your collateral is worth $4,500 → liquidated.
Mitigation: Over-collateralize significantly. Monitor positions. Set up alerts for price drops.
🔮
Oracle Risk
medium

DeFi relies on price oracles (like Chainlink) for accurate data. If an oracle reports a wrong price, liquidations or exploits can occur.

Example: Mango Markets lost $114M when an attacker manipulated the oracle price of MNGO token.
Mitigation: Use protocols with decentralized oracles (Chainlink) and multiple price feeds.
📉
Impermanent Loss
medium

When providing liquidity to a DEX pool, you can lose value if token prices diverge significantly from when you deposited.

Example: You LP with ETH/USDC. ETH doubles → you end up with less ETH and more USDC than if you just held.
Mitigation: LP with correlated pairs (stablecoin pools). Ensure trading fees exceed impermanent loss.
🚪
Rug Pull / Exit Scam
critical

Developers of a protocol drain liquidity or mint tokens to steal user funds, then disappear.

Example: Anonymous team launches a yield farm with 10,000% APY. TVL grows. Team drains the pool overnight.
Mitigation: Avoid anonymous teams with unrealistic yields. Check if contracts are verified and timelocked.
Watch Out

Common Mistakes & Gotchas

🎰
This new fork of Aave has 500% APY — I'm going all in!
Extremely high APY on unaudited forks usually means the protocol is printing worthless tokens or is a rug pull. Stick to established protocols.
I'll worry about gas later, the yield covers it
On small deposits ($100-500), gas costs can eat your entire yield. Calculate net returns after gas before depositing.
⚠️
I borrowed at 80% LTV — that maximizes my capital efficiency
Borrowing near the liquidation threshold is extremely dangerous. A 10-20% price drop could liquidate you. Keep LTV at 50% or below.
📊
APY was 12% last month so I'll earn 12% this year
DeFi rates fluctuate constantly based on supply and demand. Last month's APY is not a promise. Monitor rates regularly.

💡 Golden Rule: If you can't explain how a protocol generates its yield, you probably are the yield. Sustainable returns come from real economic activity (trading fees, loan interest), not token emissions alone.

Test Yourself

Knowledge Check

1

What does TVL measure?

2

Name two core DeFi categories:

3

Why is composability powerful?

4

What is a key risk when borrowing in DeFi?

5

Why should you check gas costs before depositing into DeFi?

Next Steps

Continue learning: “Liquidity Pools Explained” to learn how AMMs set prices and how to provide liquidity
Hands-on practice: Browse DeFiLlama to explore TVL by protocol and chain