Imagine a bank with no branches, no staff and no closing time. Anyone with a wallet can deposit, borrow or swap currencies, and every rule is written in public code. That's DeFi (decentralized finance).
It also comes with headlines like "Earn 300% APY!" So how does DeFi actually work, where does that yield come from, and what are most people missing? Let's break it down.
Key takeaways
- DeFi replaces banks and brokers with smart contracts. You interact directly from your wallet.
- Decentralized exchanges (DEXs) often use automated market makers that price trades with a formula.
- Lending is over-collateralized, and a falling collateral price can trigger liquidation.
- Stablecoins are DeFi's settlement currency, but "stable" isn't a guarantee.
- When you see a high yield, ask one question first: who's paying for it?
DeFi vs. traditional finance
| Traditional finance | DeFi | |
|---|---|---|
| Getting started | Account opening, ID checks, approval | Just a wallet |
| Hours | Business days and hours | 24/7, every day |
| Who runs the rules | Institutions and staff | Public smart contracts |
| When things go wrong | Customer support, regulators, deposit insurance | Usually no support; losses are often permanent |
| Transparency | Private books | Every transaction is on-chain |
DeFi's biggest strength is openness. Its biggest cost: you are your own bank, and you carry all the risk.
Decentralized exchanges and AMMs
On a centralized exchange, buyers and sellers are matched through an order book. Many DEXs, such as Uniswap, use an automated market maker (AMM) instead. There's no counterparty; you trade directly against a pool of tokens.

The classic pricing rule is the constant product formula:
x × y = k
The product of the two token balances stays constant. Say a pool holds 10 ETH and 25,000 USDC. Then k = 250,000, and the price is 2,500 USDC per ETH.
Now you buy 1 ETH. The pool drops to 9 ETH, so to keep k constant, it needs 250,000 ÷ 9 ≈ 27,778 USDC. You pay about 2,778 USDC before fees, 11% more than the quoted price. That's slippage: the smaller the pool and the bigger the trade, the worse it gets. Major pairs have deep pools and tiny slippage; small-cap tokens can move dramatically on a single large order.
People who deposit tokens into the pool are liquidity providers (LPs), and they earn a share of trading fees. But LPs face impermanent loss: when the two tokens' relative price changes, the position ends up worth less than if you'd simply held both tokens.
| Price change since deposit | Impermanent loss (before fees) |
|---|---|
| +25% | About 0.6% |
| −25% | About 1.0% |
| 2× | About 5.7% |
| 4× | About 20% |
| 5× | About 25.5% |
If fee income doesn't cover the loss, providing liquidity loses money. That's how LPs end up with "more tokens, less value."
Over-collateralized lending
DeFi lending protocols like Aave don't check your credit score. They rely on over-collateralization: you deposit assets worth more than what you borrow.

Why would anyone do that? Usually because they don't want to sell their ETH but need cash. It's similar to taking out a home equity loan instead of selling your house.
Protocols constantly track your health factor. Here's how it plays out:
| Item | Value |
|---|---|
| Collateral | $10,000 of ETH |
| Liquidation threshold | 80% |
| Borrowed | 6,000 USDC |
| Health factor | 10,000 × 80% ÷ 6,000 ≈ 1.33 |
| Collateral value at liquidation | 6,000 ÷ 80% = $7,500 |
In other words, a 25% drop in ETH pushes your health factor below 1 and gets you liquidated: part of your collateral is sold to repay the debt, and you pay a liquidation penalty on top. A 25% move in a day isn't unusual in crypto, and during a sharp wick, liquidations can happen within minutes. The more you borrow, the closer you sit to the line.
Stablecoins: DeFi's settlement currency
Most DeFi activity is priced and settled in stablecoins. There are three main types:
| Type | Examples | How it holds the peg | Main risk |
|---|---|---|---|
| Fiat-backed | USDT, USDC | Issuer holds cash and short-term Treasuries | Issuer trust, reserve transparency, regulation |
| Crypto-backed | DAI | Minted against over-collateralized crypto | Liquidation stress when collateral crashes |
| Algorithmic | UST (collapsed) | Algorithms and arbitrage incentives | A "death spiral" when confidence breaks |
"Stable" is never a promise. In May 2022, the algorithmic stablecoin UST collapsed within days, wiping out tens of billions of dollars in value. In March 2023, Silicon Valley Bank failed, and because part of USDC's reserves sat there, USDC briefly fell to about $0.88. Any stablecoin can lose its peg because of its reserves, its design or plain panic.
Where does high yield come from?
Before you get excited about "20% APY" or "200% APY," ask: who is paying me this?
- More sustainable sources: trading fees, interest paid by borrowers, staking rewards. These yields tend to be modest and move with the market.
- Be cautious with: rewards paid in a project's newly minted token. When the token price falls, so does your yield, sometimes to zero.
- Walk away from: anything that can't explain its yield, promises guaranteed returns or pays you to recruit others. That's a Ponzi scheme in disguise.
As the saying goes: if you don't know where the yield comes from, you are the yield.
Five risks people overlook
- Smart contract risk: a bug can let attackers drain funds. Audits reduce risk; they don't remove it.
- Oracle risk: protocols rely on outside price feeds, and a manipulated price can trigger wrongful liquidations.
- Admin key risk: some teams can upgrade or pause contracts. Check whether those powers sit behind a timelock or multisig.
- Bridge and liquidity risk: bridges are prime hacking targets (the Ronin bridge lost about $625 million in 2022), and thin pools mean big slippage on large trades.
- Approval risk: token allowances granted to contracts can be abused; see our scam prevention guide.
FAQ
How much money do I need to start with DeFi?
There's no minimum, but gas fees matter. On Ethereum mainnet, fees can eat a big chunk of a small transaction. Beginners can practice on a Layer 2 network with a small amount first.
If a DeFi protocol gets hacked, can I get my money back?
Usually not. In a few cases, hackers returned funds or the protocol compensated users from its treasury, but that's the exception. Assume you could lose everything you put in.
Does an audit mean a protocol is safe?
No. An audit covers one version of the code and the scope the auditors reviewed. Plenty of hacked protocols had been audited. Treat an audit as a plus, not a guarantee.
Is "yield farming" the same as crypto mining?
No. Yield farming means depositing tokens into pools to earn fees and token rewards. It has nothing to do with mining hardware. If someone asks you to buy a "DeFi mining machine" or deposit funds on a specific platform to "mine," be very careful.
Summary
DeFi makes finance open, transparent and composable: DEXs swap order books for formulas, lending protocols swap credit checks for collateral, and stablecoins make on-chain settlement possible. The trade-off is that there's no help desk and no safety net. Every risk is yours.
Before you dive in, understand how the protocol works, start small and only use money you can afford to lose. New to smart contracts and gas? Start with our Ethereum guide. This article is for education only and isn't investment advice.

Covers Ethereum and DeFi: smart contracts, gas, Layer 2, and how decentralized exchanges and lending protocols work, and where they can fail.
Our editorial principles →

