Module 9: DeFi Deep Dive
What DeFi Is
Chapter 1 of 14 · about 5 minutes
1.1 A bank made of code
Mint wanted to earn interest on some stablecoins. A bank would take days to open an account, ask for documents, and pay very little. A DeFi lending protocol took two minutes: connect a wallet, approve, deposit. Interest started accruing immediately.
"Who's paying me?" Mint asked. "There's no bank."
"Borrowers," said Hash. "Through a smart contract that matches them with lenders automatically, sets interest rates by formula, and liquidates borrowers who don't keep enough collateral. No staff, no branch, no opening hours. That's DeFi. It's powerful, and it fails in ways banks don't. This module is about both."
1.2 What DeFi is
Decentralised finance (DeFi) is the name for financial services built on smart contracts (Module 1, Chapter 4): trading, lending, borrowing, stablecoins, derivatives, staking, and more, running on public blockchains without a central company holding users' funds.
You've already met many DeFi building blocks in this series:
| Building block | Introduced in |
|---|---|
| Decentralised exchanges and AMMs | Module 1, Chapter 8 |
| Stablecoins | Module 1, Chapter 5 |
| Token approvals and signatures | Module 2, Chapters 7 and 8 |
| Gas, MEV, and oracles | Module 3, Chapters 2, 11, and 12 |
| Evaluating DeFi protocols | Module 5, Chapter 10 |
| On-chain DeFi data | Module 6, Chapter 9 |
| Decentralised perps and options vaults | Modules 7 and 8 |
This module brings them together and goes deeper.
1.3 The core properties
| Property | What it means | Why it matters |
|---|---|---|
| Non-custodial | You keep control of your assets until you deposit them into a smart contract, and often can withdraw any time | No company can freeze or misuse your funds, though contracts can fail |
| Permissionless | Anyone with a wallet can use it, usually without accounts or approval | Open to anyone, including people excluded from traditional finance |
| Transparent | All transactions and balances are visible on-chain | Risks and activity can be checked by anyone (Module 6) |
| Composable | Protocols can plug into each other like building blocks | Rapid innovation, and chains of dependency |
| Automated | Rules are enforced by code, without human discretion | Predictable, but unforgiving of bugs and edge cases |
1.4 Money legos
Composability is often described as "money legos." Because DeFi protocols are open smart contracts, any protocol can use any other.
Here's a simple stack:
- Mint deposits ETH into a liquid staking protocol and receives a token representing staked ETH (Chapter 8).
- Mint deposits that token into a lending protocol as collateral (Chapter 5).
- Mint borrows stablecoins against it (Chapter 7).
- Mint deposits those stablecoins into a liquidity pool on a DEX (Chapter 3).
Four protocols, each building on the last, all in minutes, with no applications or approvals. That's remarkable. It's also a chain where any weak link can break the whole thing (Chapter 12).
"So it's like building with blocks where every block can fail independently," said Node.
"And where some blocks hold up others," said Hash. "Composability multiplies both the possibilities and the risks."
Chapter 1 · Money legos
ETH is staked into a liquid staking token, which is supplied as collateral to a lending market, against which USDC is borrowed and deposited into a DEX liquidity pool. Each layer adds contract, oracle, and liquidation risk from every layer beneath it.
1.5 DeFi compared with traditional finance and CeFi
| Traditional finance | Centralised crypto finance (CeFi) | DeFi | |
|---|---|---|---|
| Who holds funds | Banks and brokers | Crypto companies | Smart contracts |
| Access | Accounts, identity checks | Accounts, usually KYC | A wallet |
| Opening hours | Business hours for many services | 24/7 | 24/7 |
| Transparency | Limited, periodic reports | Limited, sometimes proof of reserves | Full on-chain visibility |
| Recourse if something goes wrong | Regulation, deposit insurance, courts | Varies; often limited | Usually none |
| Main risks | Institutional failure, though often insured | Company fraud or failure (Module 1, Chapter 7) | Code bugs, oracle and economic failures, user error |
The 2022 collapses of several crypto lending companies, which took customer deposits and made risky loans behind closed doors, were CeFi failures. Many DeFi protocols operating transparently on-chain continued working through that period, with liquidations executing automatically. That episode made DeFi's transparency argument concrete. But DeFi has had plenty of failures of its own, through hacks, bugs, and broken economic designs.
1.6 Where DeFi yields come from
Before using any DeFi product, ask where the yield comes from (Module 2, Chapter 11, and Module 5, Chapter 10).
| Source | Example | Sustainability |
|---|---|---|
| Borrowers paying interest | Lending protocols | Depends on borrowing demand |
| Traders paying fees | DEX liquidity provision | Depends on trading volume, offset by impermanent loss (Chapter 4) |
| Network rewards | Staking (Chapter 8) | Tied to network issuance and fees |
| Funding and basis | Delta-neutral strategies (Module 7, Chapter 12) | Depends on market conditions |
| Token incentives | Liquidity mining (Chapter 10) | Temporary; paid through dilution |
| Points and expected airdrops | New protocols | Speculative |
1.7 The DeFi risk map
| Risk | Example | Chapter |
|---|---|---|
| Smart contract | A bug lets an attacker drain funds | 13 |
| Oracle | Manipulated prices trigger bad liquidations (Module 3, Chapter 12) | 13 |
| Economic design | A stablecoin's mechanism fails under stress | 7 and 12 |
| Liquidation | Collateral falls in value and your position is closed | 6 |
| Impermanent loss | Price changes reduce liquidity provider value | 4 |
| Composability and contagion | A failure in one protocol spreads to others | 12 |
| Governance and admin keys | Parameters changed or contracts upgraded against users' interests | 13 |
| User error | Wrong approvals, phishing, or sending to wrong networks (Module 2) | 13 |
1.8 Try it yourself
Open a DeFi analytics dashboard that lists protocols by category. Note the largest protocols in DEXs, lending, liquid staking, and stablecoins, and their total value locked. Then pick one lending protocol and find the current supply and borrow rates for USDC. Where would that supply rate come from?
Key takeaways from this chapter
- DeFi provides financial services through smart contracts on public blockchains, without central custodians.
- Its core properties are non-custodial, permissionless, transparent, composable, and automated.
- Composability lets protocols stack like building blocks, multiplying both innovation and risk.
- DeFi differs from traditional finance and CeFi in custody, access, transparency, recourse, and risks.
- Always trace where a yield comes from: borrowers, traders, network rewards, funding, incentives, or speculation.
- DeFi risks include smart contracts, oracles, economic design, liquidations, impermanent loss, contagion, governance, and user error.