This chapter examines the most consequential, most lucrative, and most dangerous application built on the machinery assembled in the preceding chapters. Decentralized finance, almost always shortened to DeFi, is the attempt to rebuild the core services of the financial system — trading, lending, borrowing, saving, and earning interest — out of smart contracts (Chapter 13, Ethereum and Smart Contracts) running on a public blockchain, so that no bank, broker, or exchange sits in the middle. If tokens (Chapter 16, Tokens) are the units of value Web3 moves around, DeFi is the set of automated markets and money machines that move them. It is where Web3's claim to re-architect not just the web but the economy is tested most directly — and where its genuine ingenuity and its capacity for catastrophic loss are most tightly fused. This chapter explains what DeFi is, how its main building blocks work, what it achieves that traditional finance cannot, and the serious, distinctive ways it fails. It offers no investment guidance of any kind.
In plain terms
DeFi tries to turn banks and exchanges into vending machines made of software. You interact directly with a program that holds the money and follows fixed rules, with no employee, no application form, and no one who can turn you away — but also no one to call when something goes wrong.
instead of matching buyers with sellers, a decentralized exchange like Uniswap is a pool of two tokens governed by a formula. You swap against the pool; the price is set by how much of each token is left, so big trades cost more. Ordinary people fund the pool and earn the trading fees. No order book, no broker, no closing time.
DeFi lending is a giant automated pawnshop. Lenders pour tokens into a pool and earn interest; borrowers take tokens out but must first lock up more than they borrow, and if their collateral loses value the software sells it instantly. There is no trust, no credit check, and no need to know who anyone is — but also no way to borrow if you have nothing to pledge.
DeFi runs on dollar-pegged tokens called stablecoins, because you cannot run a sensible loan or market in something whose price lurches around. They are the steady money of the system — which also means that when a big one breaks, the breakage spreads everywhere at once.
because every DeFi protocol is open and speaks the same language, they snap together like Lego bricks — the receipt from one becomes the collateral in the next. That openness is real and powerful. It also enabled "yield farming," where people chained protocols together chasing eye-popping returns that were often paid in new tokens worth little, and where each added brick was another thing that could break.
DeFi measures itself by how much money is parked inside it — Total Value Locked. That figure rocketed from under a billion dollars to somewhere around $180–253 billion at the 2021–2022 peak, then collapsed through 2022. But the number is slippery: much of its rise and fall just tracks volatile token prices, and the same dollar gets counted multiple times as it is reused across stacked protocols.
DeFi's real virtues are not imaginary. It is open to anyone, fully visible, always on, and built from interchangeable parts — a genuinely different kind of financial infrastructure. The case for it is strongest here. The case against it is strongest in what follows.
DeFi's dangers are specific and severe. Code bugs let thieves empty a contract in seconds with no way to get the money back. Collateral-free "flash loans" let attackers with no capital manipulate prices and rob protocols. Feeding a contract a fake price (oracle manipulation) is behind many of these thefts. Liquidity providers can quietly lose money to "impermanent loss." Scams are everywhere because no one is screening projects. Failures spread from one protocol to the next. And much "decentralized" finance is secretly controlled by a small team holding master keys — so users get all the risk of having no safety net and little of the independence they were promised.
What the chapter covers
- What DeFi proposes
- Decentralized exchanges and the automated market maker
- Lending, borrowing, and the logic of over-collateralization
- Stablecoins: the backbone
- Money legos: composability and the rise of yield farming
- Total Value Locked: the rise and the fall
- The genuine innovations
- The serious risks
- Synthesis
Terms explained in this chapter
The full chapter is in the book.
Buy the full book