DeFi: Financial Machinery Without the Institutions
4 steps · one page
In short
DeFi — decentralised finance — is the attempt to rebuild financial services as programs running on a blockchain, with no institution in the middle.
Concept-level article. DeFi is explained here because it accounts for a large share of digital-asset activity and because its failure modes are unlike anything else in this portal — not because a reader should use it. The losses in this area have been substantial and have arisen more often from code and design than from prices. Protocol exploits have removed very large sums in single incidents, and a participant can be entirely correct about every asset involved and still lose everything to a flaw in a contract they did not write and could not have read. This article gives no instructions for using any protocol and names none.
Lending, exchange, derivatives, and asset management, executed by code that anyone can call and nobody can refuse. Blockchain basics introduced programmability as one of four properties; this is what that property is for, and it is the most technically ambitious part of the sector. It is also the part where the gap between the promise and the operating reality is widest, and both halves of that deserve stating.
The machinery
Smart contracts are programs deployed to a blockchain that execute automatically when called and cannot be stopped mid-execution. They hold assets, enforce rules, and settle without a clearing house — the settlement is the execution. Automated market makers replace the order book with a pool of two assets and a formula: anyone can swap against the pool, and the formula moves the price as the pool's balance shifts. That is a genuine innovation — it provides continuous quotes with no market maker, no inventory decisions, and no counterparty selection. Liquidity providers deposit assets into those pools and receive a share of trading fees. Over-collateralised lending lets a borrower lock assets worth more than the loan and draw against them, with automatic liquidation if the collateral falls below a threshold — no credit assessment, because there is no credit: the collateral is the underwriting, which is why the loans must be over-collateralised and why this is not a substitute for credit as the bond pillar described it. Oracles feed external data — chiefly prices — into contracts, because a blockchain knows nothing about the world outside itself. And composability lets protocols call each other, so a position in one can become collateral in a second and be leveraged through a third. That is the source of both the sector's inventiveness and its fragility, and it is worth understanding why: a reader who deposits into one protocol may have exposure to four, and the dependencies are not disclosed on any statement.
Five failure modes, and what "code is law" actually means
Smart-contract risk. Code executes as written, not as intended. A flaw is not a dispute to be resolved but a mechanism to be used, and exploits have removed very large sums in minutes. Audits reduce this and do not eliminate it — audited protocols have been exploited, and an audit is a point-in-time review by fallible people, not a guarantee. Oracle risk. A contract acting on a price is only as sound as that price. Manipulating an oracle — or exploiting a stale or thin price feed — has been the mechanism in a significant category of incidents, and the attack does not require breaking any cryptography. Economic-design risk. Some failures involve no bug at all: the code did exactly what it was written to do, and the incentive design turned out to be exploitable under conditions the designers did not anticipate. This is the hardest category to audit for, because there is nothing wrong with the code. Composability risk. Because protocols interlock, a failure in one propagates to those depending on it, and the propagation path is often only mapped afterwards. And governance risk. Many protocols can be upgraded by holders of a governance token or by an administrative key — so the rules a participant agreed to can change, and where an admin key exists, the decentralisation is partly nominal. The existence and holder of such a key is checkable and rarely checked. Now the phrase. Code is law is offered as a feature: outcomes are determined by the program rather than by an institution's discretion, so there is no favouritism, no arbitrary refusal, and no one to change the terms after the fact. That is true, and it is exactly the problem when something goes wrong. There is no chargeback, no ombudsman, no error correction, and no counterparty to sue — an exploit that drains a pool has, in the system's own terms, executed a valid sequence of transactions. The property that removes the institution's discretion also removes its recourse, and these are the same property described from two directions — precisely the structure the custody article identified, arriving again one layer up. Two things worth adding for balance. Some protocols have operated for years handling substantial volume without incident, and the engineering discipline in parts of the sector is serious. And the transparency is real: contract code and holdings are inspectable in a way no bank's systems are, which is a genuine advantage — though inspectable is only useful to someone who can read it, and the security of the arrangement rests on the assumption that enough capable people have looked, rather than on any institution being accountable.
Worked example
Worked example (fictional). The fictional Larkspur protocol runs an automated market maker. Nadia provides liquidity to a pool holding Verex (VRX) and Meridian Dollar Token (MDT), depositing $10,000 — half in each — and earns a share of swap fees. First, a loss with no failure at all. VRX doubles. The pool's formula rebalances as traders buy VRX from it, so Nadia ends up holding less VRX and more MDT than she deposited. Her position is worth about $14,140 against $15,000 had she simply held the two assets — a shortfall of roughly $860, conventionally called impermanent loss, which is a misleading name because it is permanent once she withdraws. Nothing malfunctioned; the mechanism worked exactly as designed, and providing liquidity was worse than holding. Fees may or may not offset it, which is the actual question and is rarely presented as one. Now a loss with no price movement. A second protocol, Solane-based, accepts Larkspur pool positions as collateral. An attacker manipulates a thinly traded oracle price for a few blocks, borrows against inflated collateral, and leaves. The lending protocol is drained. Nadia deposited into Larkspur and lost money to a flaw in a protocol she never used, because her position had been made composable with it. No cryptography was broken, no key was stolen, and every transaction was valid. There is no counterparty, no insurer, and no jurisdiction in which to bring a claim. The point. Her two losses came from a design working correctly and from someone else's code failing. Neither had anything to do with whether she was right about VRX. (All names and figures fictional; VRX, MDT, Solane, and Larkspur from this pillar's fictional-asset registry; the divergence figure follows from the constant-product rule, under which the pool position is worth 2√r ÷ (1 + r) of the buy-and-hold value for a price ratio r — 0.943 at r = 2.)
Frequently asked
10 questions
What is DeFi?
An attempt to rebuild financial services — lending, exchange, derivatives, asset management — as programs on a blockchain with no institution in the middle. It's the most technically ambitious part of the sector and the part where the gap between promise and operating reality is widest.
What is a smart contract?
A program deployed to a blockchain that executes automatically when called and can't be stopped mid-execution. It holds assets and enforces rules without a clearing house — the settlement is the execution.
How does an automated market maker work?
It replaces an order book with a pool of two assets and a formula. Anyone can swap against the pool, and the formula moves the price as the pool's balance shifts. It provides continuous quotes with no market maker, no inventory decisions, and no counterparty selection — a genuine innovation.
Why must DeFi loans be over-collateralised?
Because there's no credit assessment — there's no credit. The collateral is the underwriting, which is why you must lock assets worth more than you borrow and why this isn't a substitute for credit in the sense the bond pillar describes.
What is an oracle and why does it matter?
A feed bringing external data, chiefly prices, into contracts — because a blockchain knows nothing about the world outside itself. A contract acting on a price is only as sound as that price, and manipulating or exploiting a stale or thin feed has been the mechanism in a significant category of incidents, without breaking any cryptography.
What is impermanent loss?
A misleading name for a real and permanent effect. When the assets in a pool diverge in price, the formula rebalances the pool, leaving a liquidity provider with a position worth less than simply holding the two assets would have been. Nothing malfunctions — the mechanism works as designed. Whether fees offset it is the actual question, and it's rarely presented as one.
Do audits make a protocol safe?
They reduce risk and don't eliminate it. Audited protocols have been exploited. An audit is a point-in-time review by fallible people, not a guarantee — and some failures involve no bug at all, where the code did exactly what it was written to do and the incentive design proved exploitable.
Can I lose money through a protocol I never used?
Yes. Protocols interlock, so a position in one can become collateral in another, and a failure propagates along dependencies that are often only mapped afterwards. A reader who deposits into one protocol may have exposure to several, and no statement shows this.
Isn't "code is law" a good thing?
It's true, and it's exactly the problem when something goes wrong. No institutional discretion means no favouritism and no changing the terms afterwards — and also no chargeback, no ombudsman, no error correction, and nobody to sue. An exploit that drains a pool has, in the system's own terms, executed a valid sequence of transactions. Removing the discretion removes the recourse; they're the same property from two directions.
Is anything about this genuinely better?
Two things. Some protocols have run for years handling substantial volume without incident, and parts of the sector are seriously engineered. And the transparency is real — contract code and holdings are inspectable in a way no bank's systems are. The caveat is that inspectable only helps someone who can read it, so the security rests on enough capable people having looked rather than on anyone being accountable.
References
- SEC Investor.gov — Investor Alert: Exercise Caution with Crypto Asset Securities (platforms where investors lend or borrow may lack protections; entities involved in lending or staking may be subject to securities laws) —
- SEC Investor.gov — Investor Bulletin: Crypto Asset Interest-bearing Accounts (yield-bearing crypto arrangements; assets not insured) —
- CFTC / SEC — Investor Alert: Watch Out for Fraudulent Digital Asset and "Crypto" Trading Websites —
Educational and informational only — not investment advice, a recommendation, or an offer to buy or sell any security. Investing involves risk, including the possible loss of principal. Worked examples use fictional companies and figures.