Article
DeFi Fundamentals: Lending, AMMs, and Liquidity Pools
How decentralized finance actually works - automated market makers, liquidity pools, lending markets, yield, and the impermanent loss nobody warns you about.
Banks without the bank
DeFi - decentralized finance - rebuilds financial services as open-source code that anyone can use without an account, a credit check, or a gatekeeper. Lending, trading, borrowing, earning interest: the same primitives as a bank, but the 'bank' is a smart contract that follows public rules and can't quietly change the terms on you.
The magic and the danger are the same thing: it's all automatic and irreversible. There's no manager to call. The contract does exactly what it's coded to do, which is wonderful until the code has a bug. Respect the power; verify the protocol.
AMMs: trading against a pool, not a person
Traditional exchanges match buyers with sellers via an order book. Most DeFi exchanges use an Automated Market Maker instead. Instead of finding a counterparty, you trade against a pool of two assets, and a formula sets the price based on the ratio of what's in the pool.
The classic formula is x * y = k: the product of the two reserves stays constant. Buy a lot of token X and you drain it from the pool, which pushes its price up automatically. This is why large trades suffer 'slippage' - you move the price as you trade. It's elegant: no order book, no market makers, just math and a pile of liquidity available 24/7.
Liquidity pools and where yield comes from
Those pools don't fill themselves. Liquidity providers (LPs) deposit pairs of tokens and, in return, earn a cut of every trade's fees. That's real yield: you're getting paid for providing the inventory that lets others trade.
Lending markets work similarly. You supply an asset, borrowers pay interest to borrow it (over-collateralized, so they post more than they take), and you earn that interest. When a protocol also hands out its own governance token as a reward, that's 'yield farming' - and it's worth asking how much of the advertised APY is real fees versus temporary token emissions that may evaporate.
Reading risk before chasing yield
A 4% yield from lending blue-chip assets on a battle-tested protocol is a different animal from a 4,000% farm on a three-day-old contract. High yield is a price the market pays you for taking on risk - smart contract bugs, depegging assets, mercenary liquidity that leaves the moment rewards drop.
Before you deposit, ask: Is the contract audited and old enough to have survived stress? Where does the yield actually come from? What happens if one of these tokens crashes? DeFi can be genuinely rewarding, but it rewards the people who understand what they're holding, not the ones who only read the APY.