Part V: Decentralized Finance (DeFi)

"DeFi is simultaneously the most genuinely innovative and the most genuinely dangerous application of blockchain technology. Understanding both sides of that coin — without flinching from either — is the only intellectually honest position." — Dan Robinson, research partner at Paradigm and co-author of the Uniswap V3 whitepaper

What This Part Covers

Decentralized Finance is where blockchain technology intersects most directly with real money, real risk, and real consequences. Part V covers the DeFi ecosystem with the depth and honesty that the subject demands: the genuine innovations (permissionless lending, automated market makers, composable financial primitives), the genuine risks (smart contract exploits, oracle manipulation, death spirals, systemic contagion), and the case studies that show what happens when theory meets reality. These five chapters do not tell you whether DeFi is the future of finance or a house of cards — they give you the technical understanding and the analytical framework to make that judgment yourself.

Chapter 21 establishes what DeFi is actually trying to accomplish and where the gap between promise and reality currently stands. Chapter 22 is the mathematical heart of this part: Uniswap's constant product formula (x * y = k) derived from first principles, with impermanent loss calculated using real numbers, not hand-waved with approximations. Chapter 23 covers lending and borrowing protocols (Aave, Compound), including the most novel financial primitive DeFi has produced — flash loans — and why they have been both celebrated and exploited. Chapter 24 examines stablecoins through the lens of the Terra/Luna collapse, the most instructive failure in crypto history, where an algorithmic stablecoin's death spiral wiped out $40 billion and demonstrated exactly what happens when clever mechanism design meets a market that stops believing. Chapter 25 synthesizes everything into a systematic risk framework that you can apply to any DeFi protocol.

The tone throughout is forensic, not promotional. Every protocol is analyzed for what it does well, what it does poorly, and what failure modes it is exposed to. DeFi has produced genuine innovations in market design and financial access. It has also produced billions of dollars in losses. Both of those facts are true simultaneously, and this part treats both with equal seriousness.

Chapters in This Part

Chapter Title Key Question
21 DeFi Foundations: What Decentralized Finance Is Actually Trying to Do What specific problems does DeFi solve that traditional finance cannot, and where does its promise outrun its reality?
22 Decentralized Exchanges and Automated Market Makers How does x * y = k create a functioning market without an order book, and what does it cost liquidity providers?
23 Lending, Borrowing, and Yield: Aave, Compound, and the Interest Rate Machine How do overcollateralized lending and flash loans work, and what is "real yield" versus inflationary yield?
24 Stablecoins: The Bridge Between Crypto and the Dollar How do stablecoins maintain their peg, how did Terra/Luna's peg break catastrophically, and what risks remain in USDT and USDC?
25 The DeFi Risk Stack: What Can Go Wrong and How to Evaluate Protocols What systematic framework can you use to evaluate the full risk stack of any DeFi protocol before committing capital?

Progressive Project Milestones

No progressive project milestones in this part. Part V is focused on understanding DeFi protocols as a user and analyst, not building them. The mathematical models (AMM curves, interest rate functions, liquidation mechanics) are implemented in Python for analysis, but the progressive project's smart contract development resumes in Part VI with token economics and DAO governance.

Prerequisites

You should have completed Parts I through III, with particular emphasis on smart contract programming (Chapters 13-14) and security (Chapter 15). Understanding the DeFi chapters requires comfort with Ethereum's architecture (Chapter 11), the EVM's execution model (Chapter 12), and how smart contracts interact with each other (composability). The mathematical content in Chapter 22 uses algebra — specifically, the constant product formula and calculus-level intuition for understanding how curves behave — though all derivations are worked through step by step. Basic economics concepts from Chapter 4 (supply and demand, monetary policy, inflation) are assumed.

Chapters in This Part