Skip to main content
Other Assets

DeFi (Decentralized Finance)

Pomegra Learn

DeFi (Decentralized Finance)

Traditional finance requires intermediaries: banks hold your deposits, exchanges match your trades, insurers pool your risk. These institutions capture spreads and rent from their critical position—a system so entrenched that alternatives seemed impossible. DeFi asked a different question: What if all that matching and pooling happened in smart contracts, open-source and accessible to anyone?

The result is a parallel financial system running 24/7 on blockchains, with no institutions, no intermediaries, and no customer service. You can lend your USDC to a smart contract and earn 5% APY without a credit check. You can swap Bitcoin for Ethereum in one atomic transaction without an exchange company touching your funds. You can provide liquidity to a trading pair and earn a share of fees—or lose money to adverse price movement in the same transaction. DeFi works because it replaces trust in institutions with trust in mathematics and cryptography. It fails when the mathematics breaks or when that trust in code proves misplaced.

This chapter teaches you how the major DeFi primitives function: lending protocols that collect collateral and lend against it, automated market makers that price trades algorithmically, yield farming that incentivizes liquidity provision with often-unsustainable token rewards. You'll understand liquidity pools and the impermanent loss that erodes returns over time. You'll see how governance tokens let protocol users vote on changes, and how that governance itself becomes a source of risk. You'll study flash loans—uncollateralized borrows repaid in the same transaction—and the arbitrage and attack strategies they enable. You'll examine cross-chain bridges that move assets between blockchains, and the insurance protocols that attempt to cover smart contract failures. Finally, you'll internalize composability: the insight that DeFi contracts interact like Lego blocks, stacking on each other in ways that create both powerful new products and hidden cascade failures.

Why this matters

DeFi represents a genuine innovation in financial technology: the ability to custody your own assets while accessing financial services. But its youth means it runs on immature protocols with immature governance and insufficient stress testing. Billions have been lost to bugs, exploits, and failed mechanism designs. Understanding DeFi's building blocks—and its fault lines—is essential whether you use it or simply invest in its ecosystem.

What you'll learn

This chapter begins with lending protocols like Aave and Compound, working through the mechanism that lets you deposit collateral, borrow against it, and understand liquidation mechanics. You'll study automated market makers in detail, learning why a constant-product formula creates slippage, how liquidity providers earn fees, and what impermanent loss actually means (spoiler: it's not what most LPs think). Yield farming appears next, with a critical eye on why APYs often collapse shortly after farming begins. You'll learn how LP tokens represent your stake in a pool and how they enable composability by being tradeable and stakeable in other protocols. Governance is covered thoroughly: how voting works, what attack vectors emerge, and why concentrated voting power remains a persistent problem. Flash loans deserve careful study; they're powerful tools but also the vector for some of DeFi's most sophisticated exploits. We'll examine bridges and the security assumptions they introduce, insurance protocols and their coverage limitations, and derivatives built on top of DeFi that create leverage and concentration. Finally, you'll develop intuition for composability risk: how a cascade of interdependent protocols can fail together, with a special focus on contagion mechanisms.

How to read this chapter

This is the densest chapter in the book. Lending and AMMs are foundational; understand them completely before moving forward. Yield farming and governance are critical for navigating DeFi in practice. Flash loans and derivatives can feel abstract, but they're worth grasping even if you never use them, because they occasionally blow up and drag innocent parties down with them. Composability risk is the big idea: by the end, you should see not just individual protocols but the web of dependencies that connects them.

DeFi is where crypto's ambition is most on display—and where its failures are most expensive. This chapter equips you to participate with open eyes and closed positions that match your actual risk tolerance.

Articles in this chapter