DeFi Primitives
DeFi protocols compose swaps, lending, collateral, stablecoins, derivatives, oracles, and liquidations into open financial systems.
DeFi primitives explain AMMs, flash loans, liquidation cascades, oracle risk, composability, and protocol insolvency.
The Intuition
DeFi is a stack of money-legos. Protocols can call each other directly, which creates powerful combinations and correlated failures.
See it concretely
Imagine every bank, exchange, and lending desk exposing public APIs that settle instantly. Builders can connect them like pipes, but a leak can spread quickly.
Tempting — but wrong
The precise version
Automated market makers use pricing functions instead of order books. Lending protocols use collateral ratios and liquidation mechanisms. Stablecoins attempt to maintain a target price through collateral, algorithms, or off-chain reserves. Oracles provide external price data. Flash loans allow uncollateralized borrowing within one atomic transaction as long as repayment occurs before the transaction ends.
constantProductAMM: x \times y = kCheck your understanding
Why are many DeFi loans overcollateralized?
Click to reveal answer
Why are oracles dangerous?
Click to reveal answer
- Explain AMMs, lending, stablecoins, liquidations, and oracles.
- Explain flash loans and atomicity.
- Describe composability benefits and contagion risk.
- Separate smart-contract risk from economic risk.
Why are price oracles critical in DeFi?