Back to Learn
Intermediate3 hours10 lessons

DeFi Fundamentals

Explore the world of decentralized finance. Learn how DEXs, lending protocols, and yield farming work, and understand the risks involved.

What You'll Learn

How decentralized exchanges work
AMMs and liquidity pools
Lending and borrowing protocols
Yield farming strategies
Stablecoins and their mechanics
Impermanent loss calculation
DeFi security best practices
Multi-protocol strategies

Course Content

1.

What is DeFi?

Introduction to decentralized finance and its importance

15 min
2.

DeFi vs Traditional Finance

Comparing centralized and decentralized systems

15 min
3.

Decentralized Exchanges (DEXs)

How Uniswap, Curve, and other DEXs work

25 min
4.

Automated Market Makers (AMMs)

Understanding liquidity pools and constant product formula

25 min
5.

Lending and Borrowing

Aave, Compound, and overcollateralized loans

25 min
6.

Yield Farming Strategies

Earning yield through liquidity provision

20 min
7.

Stablecoins Explained

USDC, DAI, USDT, and algorithmic stables

20 min
8.

Impermanent Loss

Understanding and calculating IL risk

20 min
9.

DeFi Security Risks

Smart contract risks, oracle attacks, and rug pulls

25 min
10.

Safe DeFi Practices

How to use DeFi responsibly

15 min
Lesson 4 Preview

Automated Market Makers (AMMs)

Automated Market Makers (AMMs) are the backbone of decentralized exchanges. Instead of using order books like traditional exchanges, AMMs use mathematical formulas to determine asset prices based on the ratio of tokens in a liquidity pool.

The Constant Product Formula

x × y = k

Where x and y are token reserves, and k is a constant

How a Swap Works

1

Pool starts with equal value

Example: 100 ETH + 200,000 USDC (k = 20,000,000)

2

User wants to buy ETH with USDC

They add USDC to the pool and receive ETH in return

3

Price adjusts automatically

More ETH bought = higher ETH price (less ETH in pool, same k)

Liquidity Providers

Liquidity providers (LPs) deposit equal values of both tokens into the pool and earn a percentage of every trade (typically 0.3%). In return, they receive LP tokens representing their share of the pool.

Important: Impermanent Loss

When you provide liquidity, you may experience "impermanent loss" if the price ratio of the tokens changes. We cover this in detail in Lesson 8.

Continue to learn about lending, yield farming, and risks...

Your Progress

0%

0 of 10 lessons completed

Top DeFi Protocols

Uniswap(DEX)
$5.2B
Aave(Lending)
$10.8B
Lido(Staking)
$14.2B
MakerDAO(CDP)
$7.1B
Curve(DEX)
$2.4B
Compound(Lending)
$2.1B

TVL data for reference only

Prerequisites

  • Understanding of Ethereum and smart contracts
  • Basic knowledge of cryptocurrencies
  • A Web3 wallet (recommended for practice)

Risk Warning

DeFi involves significant risks including smart contract bugs, impermanent loss, and market volatility. Never invest more than you can afford to lose.