Understand how the major DeFi primitives work — AMMs, lending markets, stablecoins, and yield strategies.
DeFi (Decentralised Finance) replaces traditional financial services with smart contracts.
Key primitives:
1. AMMs (Automated Market Makers)
- Uniswap v2: constant product formula x*y=k
- Uniswap v3: concentrated liquidity, tick ranges
- Curve: StableSwap invariant for low-slippage stablecoin swaps
2. Lending Protocols
- Aave v3: variable/stable rates, e-mode, isolation mode, credit delegation
- Compound v3: comet architecture, asset-specific borrow caps
- Overcollateralisation, liquidation threshold, health factor
3. Stablecoins
- Algorithmic: FRAX, partially backed
- CDP-backed: DAI, MakerDAO, collateral vaults
- Centralised: USDC, USDT
4. Yield Strategies
- Yearn Finance vaults
- Auto-compounding, harvesting, strategy rotation
5. MEV (Maximal Extractable Value)
- Arbitrage, sandwich attacks, liquidations
- Flashbots, MEV-Boost, protect users with private mempools
Key primitives:
1. AMMs (Automated Market Makers)
- Uniswap v2: constant product formula x*y=k
- Uniswap v3: concentrated liquidity, tick ranges
- Curve: StableSwap invariant for low-slippage stablecoin swaps
2. Lending Protocols
- Aave v3: variable/stable rates, e-mode, isolation mode, credit delegation
- Compound v3: comet architecture, asset-specific borrow caps
- Overcollateralisation, liquidation threshold, health factor
3. Stablecoins
- Algorithmic: FRAX, partially backed
- CDP-backed: DAI, MakerDAO, collateral vaults
- Centralised: USDC, USDT
4. Yield Strategies
- Yearn Finance vaults
- Auto-compounding, harvesting, strategy rotation
5. MEV (Maximal Extractable Value)
- Arbitrage, sandwich attacks, liquidations
- Flashbots, MEV-Boost, protect users with private mempools