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
Course Content
What is DeFi?
Introduction to decentralized finance and its importance
DeFi vs Traditional Finance
Comparing centralized and decentralized systems
Decentralized Exchanges (DEXs)
How Uniswap, Curve, and other DEXs work
Automated Market Makers (AMMs)
Understanding liquidity pools and constant product formula
Lending and Borrowing
Aave, Compound, and overcollateralized loans
Yield Farming Strategies
Earning yield through liquidity provision
Stablecoins Explained
USDC, DAI, USDT, and algorithmic stables
Impermanent Loss
Understanding and calculating IL risk
DeFi Security Risks
Smart contract risks, oracle attacks, and rug pulls
Safe DeFi Practices
How to use DeFi responsibly
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
Pool starts with equal value
Example: 100 ETH + 200,000 USDC (k = 20,000,000)
User wants to buy ETH with USDC
They add USDC to the pool and receive ETH in return
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.
Your Progress
0 of 10 lessons completed
Top DeFi Protocols
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.