Module 9: DeFi Deep Dive
Composability and Systemic Risk
Chapter 12 of 14 · about 5 minutes
12.1 When one block falls
Chapter 1 described DeFi as money legos. Hash now showed Mint the other side of that idea.
"Imagine a tower of blocks," said Hash. "A stablecoin at the bottom. A lending protocol using it. A liquidity pool built on the lending protocol's tokens. A yield vault built on the pool. Pull out the bottom block, and everything above shifts at once. DeFi's biggest disasters rarely stay in one protocol."
12.2 How risk spreads
| Channel | How it spreads risk |
|---|---|
| Shared collateral | Many protocols accept the same assets; a collapse in one asset hits all of them |
| Stablecoin dependency | Stablecoins backed by other stablecoins inherit their problems (Chapter 7) |
| Wrapped and derivative tokens | LSTs, LRTs, LP tokens, and bridged tokens depend on their underlying protocols |
| Liquidations | Forced selling in one protocol pushes prices down, triggering liquidations elsewhere |
| Shared oracles | A faulty price feed can affect every protocol using it |
| Shared code | Forks and common libraries can share the same bugs |
| Common users | Large holders spread across protocols can transmit stress when they unwind |
12.3 Case study: TerraUSD, May 2022
TerraUSD (UST) was an algorithmic stablecoin (Chapter 7) designed to hold $1 through a mint-and-burn relationship with its sister token, LUNA. A lending protocol in its ecosystem offered depositors close to 20% yield on UST, attracting billions of dollars.
| Stage | What happened |
|---|---|
| Large withdrawals and sales of UST | UST slipped below $1 |
| Arbitrage mechanism kicked in | UST holders redeemed for newly minted LUNA and sold it, pushing LUNA down |
| Confidence collapsed | More UST holders rushed to exit; LUNA supply exploded as its price collapsed |
| Contagion | Funds and lenders exposed to UST and LUNA failed, leading to forced selling of other crypto assets and further collapses |
Within days, tens of billions of dollars in value disappeared. The 20% yield, which had seemed stable, had been subsidised and depended on continuous inflows.
12.4 Case study: the LST discount, June 2022
As Chapter 8 described, the main ETH liquid staking token traded at a discount to ETH before withdrawals were possible. Large holders who had borrowed ETH against it faced rising liquidation risk as the discount widened. Some troubled lenders needed to sell large LST positions, deepening the discount. The episode showed how a token designed to track ETH could diverge under stress, and how leverage (Chapter 11) amplified the pressure.
12.5 Case study: USDC, March 2023
When a bank holding part of USDC's reserves failed (Chapter 7), USDC briefly fell to about $0.88.
| Exposure | Effect |
|---|---|
| Stablecoins with USDC in their reserves or PSMs | Slipped below $1 as well |
| Stablecoin liquidity pools | Filled with USDC as users swapped out of it |
| Lending positions using USDC as collateral or debt | Liquidation and pricing confusion |
The peg recovered once the bank's depositors were protected. But the weekend showed how a problem in the traditional banking system could ripple through DeFi within hours.
12.6 Case study: shared code, July 2023
In July 2023, a bug in certain versions of a smart contract programming language compiler affected several liquidity pools on a major stablecoin-focused DEX and on protocols using the same code. Attackers drained tens of millions of dollars. Separately, concerns grew that a large loan, collateralised by the DEX's governance token and held across multiple lending protocols, could be liquidated if the token's price fell, potentially creating bad debt for those lenders.
The episode showed two forms of contagion at once: a shared technical dependency, and concentrated collateral spread across protocols.
12.7 Correlation in crises
In normal markets, diversifying across protocols reduces risk. In crises, many risks move together:
| Normal times | Crises |
|---|---|
| Different protocols fail independently | Failures cluster, as stress spreads |
| Collateral prices move somewhat independently | Most crypto assets fall together |
| Liquidity is available | Liquidity disappears, slippage spikes |
| Borrow rates are stable | Rates spike as everyone seeks stablecoins |
| Stablecoins hold $1 | Some stablecoins wobble |
"So diversifying across ten DeFi protocols isn't like diversifying across ten unrelated businesses," said Node.
"Not when they all depend on the same few stablecoins, oracles, and collateral assets," said Hash.
12.8 Mapping your dependencies
Before entering any DeFi position, Hash suggested mapping every layer it depends on.
Mint's position: a stablecoin deposit in a yield vault.
| Layer | Dependency | What could go wrong |
|---|---|---|
| Vault | Vault smart contract and strategy | Bug, poor strategy |
| Strategy | Deposits into a lending protocol and a DEX pool | Either protocol fails |
| Lending protocol | Oracles and accepted collateral | Bad debt from oracle or collateral failure |
| DEX pool | Stablecoin pair | One stablecoin depegs |
| Stablecoins | Reserves, banks, or other stablecoins | Reserve or banking problems |
| Chain | Layer 2 network and bridge | Sequencer outage or bridge failure (Module 3) |
Six layers, any of which could fail. The vault's advertised yield didn't show any of them.
12.9 Reducing systemic exposure
- Prefer fewer layers. Simpler positions have fewer points of failure.
- Know your bottom layer. Which stablecoins, oracles, and collateral does everything rest on?
- Avoid stacking leverage on derivative tokens during uncertain periods (Chapter 11).
- Diversify across genuinely different foundations, not just different front ends on the same base.
- Keep some assets outside DeFi entirely (Module 2).
- Watch for stress signals: stablecoin pool imbalances, rising borrow rates, LST discounts, and large liquidations (Module 6).
12.10 Try it yourself
Choose one DeFi yield product. Map every layer it depends on, using the table in section 12.8 as a template. For each layer, note one specific way it could fail. Then identify which layer is the most fundamental: the one whose failure would affect all the others.
Key takeaways from this chapter
- Composability means failures can spread across protocols through shared collateral, stablecoins, derivative tokens, liquidations, oracles, code, and users.
- TerraUSD's 2022 collapse showed how subsidised yields and algorithmic designs can fail and spread contagion.
- The 2022 LST discount showed how derivative tokens can diverge under stress, amplified by leverage.
- USDC's 2023 depeg showed how traditional banking problems can ripple through DeFi.
- The 2023 compiler bug showed contagion through shared code and concentrated collateral.
- In crises, risks become correlated, liquidity disappears, and diversification helps less.
- Map your dependencies, prefer fewer layers, and watch for stress signals.