Lending, Borrowing & Liquidations
Code can lend to an anonymous stranger because it never lends more than the collateral it already holds — watched by a price feed it has to trust.
You own crypto you believe in and don’t want to sell, but you need cash now. A bank would want your name, your credit score, and a pile of paperwork. A DeFi lending protocol will lend to you in seconds — no name, no credit check, no application. How can it possibly lend to an anonymous stranger it can never track down or take to court? And what’s the catch? Hold the question.
Lending to anonymous strangers: over-collateralization
In a DeFi lending protocol, lenders deposit assets into a shared pool and earn interest; borrowers take loans out of it. But the protocol can’t run a credit check or chase a defaulter, so it flips the bank model: it demands collateral worth more than the loan. Lock $150 of crypto to borrow $100.
Your collateral is the trust. If you vanish, the protocol simply keeps or sells it. No identity required — value, held up front, does the job a credit score does at a bank. (Why borrow less than you put up? To get cash without selling your asset, to keep its upside, or to borrow a stablecoin against volatile crypto.)
Liquidations: the automatic safety valve
Collateral is only safe if it stays worth more than the loan. So if its value falls toward your debt, you cross a threshold and get liquidated: the protocol automatically sells your collateral to repay the lenders (usually with a penalty to you). This keeps every loan backed and lenders whole, even in a crash, with no one negotiating.
Be honest about it: liquidations are fast and unforgiving. Volatile collateral can be sold out from under you in minutes during a sharp move — that’s the price of borrowing against something that swings.
A liquidation, step by step: • You lock $150 of volatile crypto and borrow $100 of stablecoin; the protocol requires your collateral stay above 120% of the debt ($120). • The market drops; the price feed reports your collateral is now worth $118 — below the $120 line. • The protocol liquidates: it sells enough collateral to repay the $100 (plus a penalty), making lenders whole. • You keep the borrowed $100, but lost collateral at a bad moment and paid a penalty. Every step hinged on one number: the reported price.
The oracle problem: the contract needs to know the price
To know when to liquidate, the protocol must know your collateral’s current price — but a blockchain can’t see outside itself. It relies on a price oracle: a service that brings off-chain market prices on-chain.
That’s a critical dependency and a real attack surface. Feed a manipulated price and you can trigger wrongful liquidations (a false low) or sneak out under-collateralized loans (a false high). So DeFi lending’s safety rests not only on the contract’s code (lesson 8) but on the honesty of its price feed. It’s the first big bridge from on-chain certainty to off-chain truth — and the next lesson pushes that bridge all the way into the physical world.
A DeFi lending pool is an automated pawnshop. Hand over a watch worth $150 and walk out with $100 cash — no name, no credit check, because the watch is the trust. If the watch’s market value slips toward $100, the pawnshop instantly sells it to get its money back (liquidation). But here’s the rub: this pawnshop is blindfolded and has to ask an assistant for the watch’s price (the oracle). Bribe the assistant to lie and the pawnshop either sells your watch for no reason or hands out cash against junk. The collateral keeps it honest; the price feed is its blind spot.
Why over-collateralization replaces a credit check: 1. A bank lends on trust built from identity, credit history, and the legal right to collect — none of which exist for an anonymous on-chain borrower. 2. So the protocol substitutes the one thing it CAN rely on: value it already holds. You deposit $150 to borrow $100. 3. If you repay, you get your collateral back. If you don’t, the protocol already holds more than it lent, so lenders can’t lose from your disappearance. 4. To keep that guarantee valid as prices move, it watches the collateral’s value (via an oracle) and liquidates before the buffer is gone. 5. Identity was never needed — collateral plus a price feed did the entire job a bank does with paperwork.
This is the reading. The interactive version — active-recall quiz, a hands-on experiment you run in your own AI, and an earned mastery check — is free in the app.
Start this lesson free →