Article
DeFi Fundamentals: Banking Without the Bank
A beginner-friendly map of decentralized finance: DEXes and AMMs, lending and liquidations, yield farming, stablecoins, composability, and the very real risks of trusting your money to code.
Table of contents
What DeFi Is and How It Differs From the Bank
DeFi, short for decentralized finance, is the wild attempt to rebuild the financial system with code instead of companies. Traditional finance, or TradFi, runs on trusted middlemen: banks hold your money, brokers place your trades, and all of them can freeze accounts, set hours, and take a cut. DeFi swaps those middlemen for smart contracts, self-running programs on a blockchain that execute exactly as written. The pitch is open, permissionless, and always on. No application form, no banker's approval, no closing at 5 p.m. Anyone with a wallet and an internet connection can lend, borrow, trade, or earn. The flip side, which we will hammer later, is that with no middleman there is also no safety net. You are your own bank, which means you are also your own fraud department.
DEXes and Automated Market Makers
A decentralized exchange, or DEX, lets you swap one token for another without an order book or a company in the middle. Most run on a clever invention called an automated market maker, or AMM. Instead of matching buyers to sellers, an AMM uses pools of tokens and a math formula to set prices automatically. Want to trade? You swap against the pool, and the formula adjusts the price based on what is left. It is like a vending machine that quietly raises the price as the snacks run low. This design means trades can happen any time, instantly, because the pool is always there. The trade-off is that prices move as you trade, which leads us to a couple of gotchas every DeFi newcomer needs to understand before diving in.
Liquidity Pools, Slippage, and Impermanent Loss
Those AMM pools are filled by liquidity providers: regular users who deposit pairs of tokens and, in return, earn a slice of the trading fees. Without them, there is nothing to trade against. Two gotchas come with the territory. Slippage is the gap between the price you expected and the price you got, and it widens on big trades or thin pools, because your own order shoves the price as it fills. Impermanent loss is sneakier. When the prices of your two pooled tokens drift apart, you can end up with less value than if you had simply held them in your wallet. It is called impermanent because the gap shrinks if prices return, but if you withdraw while they are apart, the loss becomes very permanent. Fees can offset it; they do not always.
Lending, Borrowing, and Over-Collateralization
DeFi lending lets you earn interest by supplying your tokens to a pool that others borrow from, all governed by code rather than a loan officer. The strange part for newcomers is over-collateralization. To borrow, you must first lock up more value than you take out, sometimes well over a hundred and fifty percent. Why borrow against money you already have? Often to get liquidity without selling an asset you want to keep, or to lever up. Because the protocol cannot chase a deadbeat in court, it protects itself with collateral instead of trust. There is no credit check and no name required; the math is the only judge. Your locked tokens are the entire reason a stranger's pool is willing to lend to an anonymous wallet on the other side of the planet.
Liquidations: When the Margin Call Comes
Over-collateralization sets up the most dramatic moment in DeFi: liquidation. If the value of your locked collateral falls too close to what you borrowed, the protocol automatically sells your collateral to repay the loan, usually with a penalty fee on top. No warning call, no grace period, just code doing its job the instant your ratio crosses the line. Picture pawning a watch for cash; if the watch's value drops, the pawnshop sells it before it can lose money, except here it happens in seconds and around the clock. This is why DeFi borrowers obsess over their health factor, a number measuring how close they are to the danger zone. Volatile markets can trigger waves of liquidations in minutes. Borrow conservatively, or the very automation that makes DeFi fair can also make it merciless.
Yield Farming and Stablecoins
Yield farming is the sport of chasing returns by moving crypto between protocols to harvest the best rewards, often paid in bonus tokens on top of regular interest or fees. In the frenzy of DeFi Summer in 2020, eye-popping yields lured a flood of capital, and the game has been part skill, part hot-potato ever since. Sky-high advertised returns usually carry sky-high risk, so the magic word is sustainable. Stablecoins are the steady heartbeat under all of it. These are tokens designed to track a steady value, typically one US dollar, giving traders a safe harbor without leaving crypto. They are the dollars of DeFi: the unit you price things in, park value in between trades, and lend or borrow most safely. Without them, every transaction would be a roller coaster ride priced in something that never sits still.
Composability: The Money Legos
Here is the superpower that makes DeFi more than just online banking. Because protocols are open and speak the same language, they snap together like Lego bricks. A token you earn from lending can be deposited into a second protocol as collateral, which mints a stablecoin you swap on a DEX, which you then farm somewhere else, all in one chain of transactions. Developers call this composability, and the nickname money legos fits perfectly. Anyone can build a new app on top of existing ones without asking permission, which is why DeFi innovates at breakneck speed. But legos cut both ways. When everything is stacked together, a crack in one brick can shake the whole tower. A failure or exploit in a foundational protocol can ripple through every app built on top of it, which brings us to the risks.
The Risks You Cannot Ignore
DeFi's openness is also its danger. Smart-contract bugs are the big one: the code is law, and if that law has a flaw, attackers can drain funds with no recourse and no refund. Even audited contracts get hacked, so audited never means invincible. Oracle attacks are subtler. Protocols rely on oracles, data feeds that report outside prices to the blockchain, and if an attacker can manipulate that feed, they can trick a protocol into mispricing collateral and looting it. Rug pulls round out the list, where a project's creators hype a token, lure in deposits, then vanish with the money. The takeaway is not to run away screaming. It is to enter with clear eyes: start small, stick to battle-tested protocols, understand what you are signing, and never deposit more than you can afford to lose.