‹ Understanding DeFi Lesson 16 of 16
Contents Lesson 16 of 16

6 min read · professional

Understanding DeFi — course checkpoint

You began with a vending machine and finish with the arithmetic of a parallel financial system. Assemble it once and it reads as one argument, not sixteen topics.

The four units, in one breath

Smart contracts and composability. A smart contract is a deterministic program that holds assets, executes without discretion, and is immutable unless someone built and kept an upgrade key. It cannot reach off-chain — hence oracles — and every operation costs gas. Permissionless means no gatekeeper in the code path; it does not mean free, private, unregulated or ownerless — the question is always permissionless at which layer. Composability lets contracts call each other atomically: five components each 99% safe give 0.99⁵ = 95.1%, and independence is generous. It manufactures leverage quietly — 10,000 ÷ (1 − 0.75) = $40,000 of deposits, 4× exposure, liquidatable on a 6.25% move. Code that is wrong stays wrong until somebody upgrades it or intervenes socially, and neither is guaranteed. Note how differently the famous losses actually failed: The DAO was a reentrancy bug in the contract and ended in a chain split; Wormhole was a signature-verification flaw, patched, with the hole refilled by an investor; Ronin was stolen validator keys and no contract bug at all; Euler was a donation attack whose funds were negotiated back. Billions of dollars, audits notwithstanding — and four different failure modes wearing one label. Total loss is a live outcome.

AMMs and liquidity. A constant-product pool prices by algebra: x × y = k, spot = y/x, price impact = Δx / (x − Δx). A 10 ETH / 20,000 USDC pool charges 2,222.22 USDC for one ETH — 11.11% above spot, against 0.10% in a pool a hundred times deeper. Fees make k ratchet upward, and that growth is the LP's income. Impermanent loss is the other side: IL = 2√r/(1+r) − 1, so a 2× move costs 5.72% against holding — $56,568.54 in the pool against $60,000 in a wallet, symmetric, convex, and permanent the moment you withdraw. An LP's real position is fees earned minus impermanent loss — a short-volatility trade with a coupon that can finish behind doing nothing.

Stablecoins and lending. A peg is not a property; it is the output of a mechanism. Fiat-backed pegs rest on redemption at par, therefore on banks — USDC to about $0.87 in March 2023 on a $3.3 billion SVB exposure. Crypto-collateralised pegs rest on liquidations completing — Black Thursday, zero-bid auctions, 5.67 million DAI of bad debt. Algorithmic pegs rest on circular collateral: Terra/UST paid a subsidised 19.5%, then LUNA minted = UST burned ÷ LUNA price put the price in the denominator — 350 million tokens to over 6.5 trillion and roughly $40 billion gone in a week, without a line of code failing. Lending is over-collateralised because there is no borrower to assess and no court to use: HF = Σ(collateral × liquidation threshold) ÷ debt, and HF 1.10 is a 9.09% buffer (1 − 1/HF), not 10%. Liquidation is a stranger repaying half your debt for collateral at a 5% bonus — a dependency on incentivised third parties.

Where yield comes from. Fees and borrowing interest are real revenue: supply rate ≈ borrow rate × U × (1 − reserve factor), or 5.04% at 70% utilisation and an 8% borrow rate. Emissions are dilution, not income, and APR = (E × P) ÷ TVL decays because success moves two variables against you: 20% becomes 4% when capital arrives, 2% when the token halves, 1% when the schedule tapers. A pool's spot price moves as (x ÷ x_new)², so removing 90% of a reserve reports a 100× price — and flash loans reduce the capital needed to nothing.

The three habits worth keeping

  1. Ask who pays. Every yield is somebody's cost — a trader, a borrower, or a printing press. There is no fourth option, and the answer decides whether the number lasts.
  2. Ask what the contract believes, and why. Many of the large losses — and nearly all the oracle ones — reduce to a protocol acting correctly on an input that was wrong. Not all of them: reentrancy, broken access control and stolen keys are failures of the code and the operator rather than of what the code was told.
  3. Do the subtraction. Fees minus impermanent loss. Yield minus emissions. The advertised figure is nearly always one term of an equation whose second term nobody printed.

What this course deliberately did not do

It never suggested using a protocol, providing liquidity, borrowing, or pursuing a yield — not once and not implicitly, and it endorsed nothing. Protocols, tokens and incidents were named only as documented case studies, every figure was rounded and illustrative, and every high advertised APY was treated as what it is: an encoding of risk, of token emissions, or both. Smart-contract exploits have caused total, unrecoverable losses. Nothing here is investment, tax or legal advice; rules differ by jurisdiction and change.

Before you sit it

Each of these is a minute at your desk. Any one that is not names the lesson to reopen first.

Try it now

  1. Read a price off the chart below and build one pool position on paper: k and spot, the price impact of a trade taking 2% of the reserve, the impermanent loss at the one-year ratio you can Measure from the same chart, and the fee income required to break even.
Interactive line chart: ETH-USD.CC (1Y)
  1. Build one borrow on paper: collateral, liquidation threshold, debt, health factor, the price at which HF = 1, and the liquidation outcome at a 50% close factor and 5% bonus.
  2. Write two sentences that close this course honestly — one naming where a yield comes from, one naming what could take the position to zero. If both are neutral and free of any recommendation, you have learned what this course set out to teach.

Checkpoint quiz next. Nothing in these sixteen lessons was a recommendation to use any protocol, provide liquidity, or chase any yield — you have learned the mechanics and the arithmetic that describe them, which is a skill, not a signal.