Stablecoins and DeFi: lending, exchanges, and yield without a bank
Decentralised finance rebuilds exchanges, lending and savings out of smart contracts. How stablecoins hold their peg; how automated market makers set prices, worked step by step; impermanent loss, with a calculator; where DeFi yields really come from; and how TerraUSD, a stablecoin of about $18 billion that paid deposit yields near 20%, collapsed in May 2022.
Facts reviewed Oct 2026
In May 2022, a stablecoin called TerraUSD (UST) was meant to be worth exactly one US dollar. It was one of the largest stablecoins in the world, and a linked lending protocol advertised yields near 20% on deposits.
Within days, it lost its peg and collapsed towards zero. It took its sister token, LUNA, down with it, wiping out tens of billions of dollars. Many holders had believed they owned something as safe as a dollar.
Decentralised finance (DeFi) is a genuinely new way of building financial services out of code. It’s also where some of crypto’s biggest blow-ups have happened. Understanding how it works is the best protection against the next one.
Stablecoins: crypto that tries to stay still
A stablecoin is a token designed to track a stable asset, usually the US dollar. Three designs dominate:
| Type | How it holds its peg | Main risk | Examples |
|---|---|---|---|
| Fiat-backed | A company holds cash and short-term government bonds, and redeems tokens for dollars | The issuer’s reserves, honesty and banks | USDT, USDC |
| Crypto-backed | Users lock up more crypto than the stablecoins they create; positions are sold off if the crypto falls | Crashes faster than the sell-offs can keep up | DAI |
| Algorithmic | A mechanism creates and destroys a partner token to push the price back to $1 | A loss of confidence becomes a death spiral | TerraUSD (collapsed 2022) |
Stablecoins are the plumbing of crypto. Most trading and DeFi activity is priced in them. They also matter beyond crypto, as a dollar substitute in countries with unstable currencies. That’s one reason central banks, including the RBI, watch them warily.
A real case: TerraUSD’s death spiral, May 2022
TerraUSD was algorithmic. It held no dollars. Instead, it promised that 1 UST could always be swapped for $1 worth of LUNA, its partner token.
How it was meant to work:
- If UST fell below $1, traders could buy UST cheaply, swap it for $1 of LUNA, and pocket the gain. That buying would push UST back up.
- If UST rose above $1, traders would do the reverse.
The weak spot: the system only worked as long as LUNA kept its value. In early May 2022, UST was worth about $18 billion. Much of it sat in the linked lending protocol, earning close to 20%. When large holders began withdrawing and selling:
- UST slipped below $1;
- holders rushed to swap UST for LUNA, creating vast amounts of new LUNA;
- the flood of new LUNA crushed its price;
- so each UST could only be swapped for less real value, and confidence collapsed further.
Within about a week, UST was worth a few cents, and LUNA almost nothing.
The lessons:
- A stablecoin is only as stable as what backs it. UST was backed by confidence in another token.
- A very high “safe” yield is a warning, not a gift. Someone has to pay it.
- Runs can happen to code, too. The death spiral was a classic bank run, just faster.
Automated market makers: exchanges without an order book
A stock exchange matches buyers with sellers. A decentralised exchange, such as Uniswap, works differently. It uses a liquidity pool: a smart contract holding two tokens, supplied by liquidity providers. Traders swap against the pool, and a formula sets the price. The classic one is the constant product rule:
(amount of token A) × (amount of token B) = k, a constant
Worked example. A pool holds 10 ETH and 30,000 stablecoins. So k = 10 × 30,000 = 3,00,000, and the price is 3,000 per ETH.
- You buy 1 ETH. The pool now holds 9 ETH.
- To keep k the same, it must hold 3,00,000 ÷ 9 ≈ 33,333 stablecoins.
- So you pay 33,333 − 30,000 = 3,333 stablecoins for that 1 ETH: about 11% above the starting price.
Big trades in small pools move the price a lot. That’s slippage. Liquidity providers earn a fee on every trade.
Impermanent loss: the hidden cost of providing liquidity
Liquidity providers face a subtle cost. When one token’s price rises, traders buy it from the pool, until the pool’s price matches the wider market. So the pool ends up holding less of the token that rose, and more of the one that didn’t.
Compared with simply holding both tokens, the provider is worse off. That shortfall is impermanent loss. It disappears only if prices return to where they started.
Constant-product pool, one volatile token paired with a stablecoin, no rebalancing by you. Impermanent loss depends only on the price ratio, not on the direction of the move.
If the token doubles, the pool is worth about 5.7% less than simply holding. If it quadruples, about 20% less. Big moves in either direction hurt. Trading fees can offset this. That’s why busy pools with modest price swings suit liquidity providers best.
You put ₹1 lakh into a 50/50 pool of a volatile token and a stablecoin. The token's price doubles. Compared with simply holding the two tokens, your pool position is worth:
Traders buy the rising token from the pool, leaving you with less of it. With a 2× price move, the shortfall is 2√2 ÷ 3 − 1 ≈ −5.7%, which trading fees may or may not cover.
Lending without a bank
DeFi lending protocols, such as Aave and Compound, let users deposit tokens to earn interest, and borrow against collateral.
Loans are over-collateralised. You might lock ₹1.5 lakh of ETH to borrow ₹1 lakh of stablecoins. If the collateral’s value falls below a threshold, anyone can liquidate the position. They repay the loan and claim the collateral at a discount.
No credit scores, no paperwork, and no mercy in a crash.
Where does DeFi yield come from?
Before trusting any yield, ask what pays it:
- Real sources: borrowers paying interest, traders paying fees, or protocol revenue.
- Token rewards: protocols paying users in their own newly created tokens. The yield lasts only as long as someone wants to buy those tokens.
- Leverage and recycling: borrowing against deposits to deposit again. That multiplies both yield and liquidation risk.
- Nothing lasting: TerraUSD’s high deposit yield was subsidised, and collapsed with the peg.
Going further: why algorithmic stablecoins keep failing. A bank that issues deposits holds loans and reserves against them. A fiat-backed stablecoin holds cash and bonds. If holders want their money back, there’s something real to pay them with. An algorithmic stablecoin has nothing real behind it. Its only support is a promise to swap it for another token, whose value depends on people believing the system works. That creates a loop. When confidence is high, the partner token is valuable, and the peg holds easily. When confidence cracks, people swap out, the partner token is created in huge amounts and crashes, and the peg breaks further. Economists call this reflexivity: the price affects the fundamentals, which affect the price. Many algorithmic designs before and after TerraUSD have failed the same way. The lesson for any “stable” asset: ask what you’d actually get in a rush to the exit.
Common mistakes
- Trusting the word “stable”. Check what backs the coin.
- Chasing a high “safe” yield. Ask who pays it.
- Ignoring impermanent loss when providing liquidity.
- Borrowing close to the liquidation line. A sharp fall wipes you out.
- Assuming code can’t be hacked. Smart-contract bugs have cost billions.
Practice 1: How much in trading fees does a pool need to earn, to break even with holding, if the token's price triples?
- Impermanent loss at 3×: 2√3 ÷ 4 − 1 ≈ −13.4%.
- Fees needed: 1 ÷ 0.866 − 1 ≈ 15.5% of the pool’s value.
Set the price to 3×, and raise the fees until “Pool value including fees” matches “Value if you had just held”.
Practice 2: You lock ₹1.5 lakh of ETH to borrow ₹1 lakh of stablecoins. The protocol liquidates if your collateral falls below 120% of the loan. How far can ETH fall before you're liquidated?
- Liquidation level: 120% × ₹1 lakh = ₹1.2 lakh of collateral.
- Fall allowed: from ₹1.5 lakh to ₹1.2 lakh = 20%.
A 20% fall in ETH is common in a bad week. Many DeFi borrowers have been liquidated in exactly such moves.
Key takeaways
- Stablecoins track a currency through cash reserves, crypto collateral or algorithms. TerraUSD, an algorithmic design worth about $18 billion, collapsed in May 2022.
- Automated market makers set prices with formulas like x × y = k. Liquidity providers earn fees, but face slippage and impermanent loss.
- Impermanent loss (2√r ÷ (1 + r) − 1) means big price moves in either direction leave liquidity providers worse off than holding.
- DeFi lending is over-collateralised, with automatic liquidations in a crash.
- Always ask where a yield comes from. Smart-contract, oracle and governance risks have no regulator or insurance behind them.
Go deeper
- Ethereum Foundation: Decentralised finance (DeFi).
- Bank for International Settlements: Annual Economic Report chapters on stablecoins and DeFi.
- RBI: Financial Stability Report sections on crypto-assets and stablecoins.