Part IV · 1 — DeFi: finance without an intermediary
If Ethereum is a world computer, DeFi is what got built on it the most: rebuilding financial services — swapping, lending, yielding — as open contracts, with no bank or broker in the middle. Here are the pieces and why they fit together.
1.1 What changes without an intermediary
Traditional finance relies on a trusted institution that custodies assets and executes orders. DeFi (Decentralized Finance) replaces the institution with smart contracts (Part III): the code custodies and executes, publicly and auditably, without permission.
Three properties come for free — and they define the genre:
- Permissionless — anyone can use it, with no registration or approval.
- Composable — protocols snap together like "money legos": the output of one
is the input of another, composing complex products out of simple pieces.
- Non-custodial — you control your assets with your key; the contract does not
"hold" your money, it only executes rules.
The brutal trade-off: code is law. A bug moves real, irreversible money; there is no manager to reverse it.
1.2 AMM: swapping without an order book
The most elegant piece of DeFi is the AMM (Automated Market Maker). Instead of matching buyers and sellers in an order book, a liquidity pool holds two assets and prices them by a formula. The most common is the constant product:
The pool maintains
x · y = k(constant). Buying asset X means returning enough Y to keep the product — the price emerges from the ratio of the reserves.
Whoever deposits both assets is a liquidity provider (LP) and earns fees from swaps — but bears impermanent loss: if relative prices change, holding the pair in the pool yields less than simply holding the assets. Uniswap popularized the model.
1.3 Lending, stablecoins and the rest of the pieces
- Lending — protocols (Aave, Compound) where you deposit collateral and borrow
against it. If the collateral's value falls below a threshold, the position is liquidated automatically. Everything is over-collateralized (you lock more than you take), because there is no credit analysis.
- Stablecoins — tokens pegged to a currency (usually the dollar). There are the
collateralized ones, backed by fiat reserves (USDC) or by over-collateralized crypto (DAI), and the algorithmic ones — which try to hold the peg purely through incentives and have collapsed spectacularly (Terra/UST, 2022).
- Oracles — DeFi needs real-world prices on-chain; oracles (Chainlink, Pyth)
deliver them. They are a critical point: a manipulated oracle breaks an entire protocol (a common attack vector).
Dense reference: AMMs, stableswap, lending, stablecoins, liquid staking and oracles in
09-defi. Next: NFTs, RWA and beyond — when the token represents something that is not money.