4.1 What is DeFi?
Decentralized Finance (DeFi) recreates traditional financial services using smart contracts on public blockchains, eliminating intermediaries and enabling permissionless, programmable money.
DeFi vs. Traditional Finance
| Aspect | Traditional Finance | DeFi |
|---|---|---|
| Intermediaries | Banks, brokers, clearinghouses | Smart contracts |
| Access | KYC/AML required, geographic limits | Permissionless, global |
| Operating Hours | Business hours, holidays | 24/7/365 |
| Transparency | Limited, audited quarterly | Real-time, on-chain |
| Custody | Third-party (bank) | Self-custody |
| Settlement | T+2 days (stocks) | Seconds to minutes |
| Composability | Siloed systems | "Money Legos" - interoperable |
Key DeFi Primitives
- Lending/Borrowing: Collateralized loans without credit checks
- Decentralized Exchanges: Token swaps without order books
- Stablecoins: Price-stable assets pegged to fiat currencies
- Yield Aggregators: Automated yield optimization
- Derivatives: Synthetic assets and options
- Insurance: Coverage against smart contract failures
DeFi protocols can be combined like building blocks. A user can: (1) deposit ETH as collateral, (2) borrow DAI, (3) swap DAI for USDC on a DEX, (4) provide liquidity to earn fees - all in a single transaction. This composability enables complex financial strategies but also creates systemic risk.
4.2 Lending Protocols
DeFi lending enables users to earn interest on deposits or borrow against collateral without intermediaries. Interest rates are determined algorithmically based on supply and demand.
How Lending Protocols Work
Major Lending Protocols
Multi-chain lending protocol with variable and stable interest rates, flash loans, and governance token (AAVE). Supports 7+ blockchains including Ethereum, Polygon, and Arbitrum.
- aTokens: Interest-bearing tokens representing deposits
- Flash Loans: Uncollateralized loans repaid in same transaction
- Credit Delegation: Allows undercollateralized borrowing through trust
Pioneer of algorithmic interest rate markets. Users supply assets to earn interest or borrow against collateral. COMP governance token enables community control.
- cTokens: ERC-20 tokens representing supplied assets
- Interest Rate Model: Algorithmic rates based on utilization
- Governance: COMP holders propose and vote on changes
Key Concepts
Interest-bearing tokens (aTokens, cTokens) may constitute securities under certain jurisdictions' laws. The Howey test analysis depends on expectations of profit, common enterprise, and reliance on others' efforts. Legal status remains unsettled.
4.3 Decentralized Exchanges (DEXs)
DEXs enable token swaps without centralized order books or custodians. The dominant model uses Automated Market Makers (AMMs) with liquidity pools.
Automated Market Makers (AMMs)
Constant Product Formula (Uniswap v2)
The most common AMM formula: x * y = k
- x: Quantity of Token A in the pool
- y: Quantity of Token B in the pool
- k: Constant (product must remain unchanged)
Example: Pool has 100 ETH and 200,000 DAI (k = 20,000,000). To buy 1 ETH, you must add enough DAI to maintain k.
Major DEX Protocols
The largest DEX by volume. Pioneered the constant product AMM model. Uniswap v3 introduced concentrated liquidity positions for capital efficiency.
Optimized for stablecoin swaps with minimal slippage using the StableSwap invariant. Critical infrastructure for DeFi stablecoin liquidity.
Liquidity Provision
Users deposit token pairs into pools and earn trading fees proportional to their share. However, liquidity providers face impermanent loss.
You deposit $1,000 worth of ETH and $1,000 USDC into a pool.
ETH price doubles. If you had just held: $2,000 ETH + $1,000 USDC = $3,000
In the pool: Arbitragers rebalance, you now have ~$1,414 ETH + ~$1,414 USDC = $2,828
Impermanent loss: $172 (5.7%)
Trading fees may or may not compensate for this loss.
4.4 Yield Farming & Aggregators
Sources of Yield
| Source | Description | Risk Level |
|---|---|---|
| Lending Interest | Interest paid by borrowers | Low-Medium |
| Trading Fees | Share of DEX swap fees | Medium |
| Liquidity Mining | Token incentives for providing liquidity | Medium-High |
| Staking Rewards | Proof-of-Stake validator rewards | Low-Medium |
| Governance Tokens | Protocol token distributions | High (volatile) |
Yield Aggregators
Automated protocols that optimize yield by automatically moving funds between strategies.
Pioneer of yield aggregation. "Vaults" automatically compound and optimize yields across DeFi protocols. Users deposit assets and receive yield-bearing vault tokens.
Smart Contract Risk: Bugs in any protocol in the strategy chain
Impermanent Loss: For strategies involving LP positions
Token Price Risk: Reward tokens may collapse in value
Rug Pull Risk: New protocols may be malicious
Gas Costs: Frequent transactions can erode returns
Regulatory Risk: Unclear legal status of yield farming
4.5 Stablecoins
Stablecoins maintain a stable value (usually $1 USD) and are essential DeFi infrastructure for trading, lending, and payments.
Stablecoin Types
| Type | Mechanism | Examples | Risks |
|---|---|---|---|
| Fiat-Backed | 1:1 reserves in bank accounts | USDC, USDT, BUSD | Counterparty, regulatory |
| Crypto-Backed | Over-collateralized crypto deposits | DAI, LUSD | Liquidation cascades |
| Algorithmic | Algorithmic supply adjustment | FRAX (partial) | Death spiral (see UST) |
Case Study: MakerDAO & DAI
DAI is a decentralized, crypto-collateralized stablecoin governed by MakerDAO.
- Users deposit collateral (ETH, WBTC, etc.) into a "Vault"
- Users mint DAI against their collateral (minimum 150% collateralization)
- Users pay a "Stability Fee" (interest) when repaying DAI
- If collateral falls below threshold, position is liquidated
- DAI Savings Rate (DSR) incentivizes DAI holding
In May 2022, the algorithmic stablecoin UST (backed by LUNA) collapsed from $1 to near $0, destroying $40+ billion in value. The "death spiral" occurred when UST lost its peg, causing LUNA hyperinflation as the algorithm tried to restore the peg. This event triggered increased regulatory scrutiny of stablecoins globally.
US: Proposed legislation (Stablecoin TRUST Act) would require federal or state licensing
EU: MiCA requires stablecoin issuers to be authorized credit institutions
UK: Financial Services and Markets Bill brings stablecoins under FCA regulation
Singapore: MAS regulates stablecoins pegged to Singapore dollar
Key Takeaways
- DeFi recreates financial services using smart contracts, enabling permissionless, 24/7 access
- Lending protocols require over-collateralization and automated liquidation
- AMM DEXs use mathematical formulas instead of order books
- Impermanent loss is a key risk for liquidity providers
- Yield farming combines multiple DeFi primitives for returns - and risks
- Stablecoins are critical infrastructure but face regulatory scrutiny
- Composability enables innovation but creates systemic contagion risk