What Is DeFi
Decentralized finance explained simply: how swaps, lending and liquidity pools run on smart contracts, and what risks come with them.
DeFi, short for decentralized finance, is the umbrella term for financial services that run on a blockchain without a bank, broker or exchange acting as the middleman. Instead of a company enforcing the rules, a program called a smart contract does it, and users interact with that program directly from their own crypto wallet.
How DeFi differs from traditional finance
In the familiar system, a bank holds your money and decides whether to approve a transfer, a loan or a new account. DeFi works on different principles:
- No intermediary. Smart contract code is public, so anyone can check what it actually does.
- Permissionless access. Usually all you need is a wallet. There are no application forms or manager approvals.
- Self-custody. Funds stay in the user's wallet or inside a smart contract rather than in a company's account.
- Transparency. Every operation is recorded on the blockchain and can be viewed in a block explorer.
- Composability. Protocols can be plugged into one another like building blocks, so a token from one service can be used in another.
Most early DeFi applications were built on Ethereum, but similar services now run on many other blockchains and on layer-2 networks.
The main kinds of DeFi services
Decentralized exchanges
A DEX lets you swap tokens straight from your wallet. Many of them use an automated market maker (AMM) model. Instead of an order book, there is a pool holding two tokens, and the price is calculated by a formula based on the ratio between them. The larger a trade is compared with the size of the pool, the more it moves the price. This effect is called slippage.
Liquidity pools
The tokens in these pools come from users known as liquidity providers, who earn a share of the trading fees in return. This setup carries a specific risk called impermanent loss: if the prices of the two tokens move a lot relative to each other, a provider can end up with less value than if they had simply held the tokens.
Lending and borrowing
Lending protocols let you deposit crypto as collateral and borrow a different token against it. The collateral almost always has to be worth more than the loan, which is called overcollateralization. If the collateral value falls below a set threshold, the smart contract automatically sells part of it to repay the debt. This is a liquidation, and no human is involved in triggering it.
Stablecoins
Stablecoins are the backbone of many DeFi activities because their value is pegged to the dollar or another asset. Some are issued by companies and backed by reserves, while others are created inside DeFi against crypto collateral.
What using DeFi looks like
A typical flow goes like this: a person opens a protocol's website, connects a wallet and confirms a transaction. The website is only an interface; the real work happens in the smart contract. Every transaction requires a network fee, known as gas, which can be noticeable when the network is busy.
One detail matters a lot: token approvals. Before a protocol can move your tokens, you grant its smart contract permission to spend them. These approvals stay in place until you revoke them, so it is worth knowing which contracts you have authorized and for how much.
The risks of DeFi
No middleman also means nobody to reverse a mistake. The main risks include:
- Code bugs. A vulnerability in a smart contract can let an attacker drain funds. Audits reduce this risk but cannot remove it.
- Fraudulent projects. The creators of a token or protocol can disappear with users' money, a scheme known as a rug pull.
- Phishing. Fake websites and malicious transaction signatures can hand an attacker access to your tokens.
- Oracle failures. Many protocols get prices from external data feeds called oracles. Bad data can trigger unfair liquidations.
- Stablecoin depegs. A stablecoin can drift away from its peg, affecting every service that relies on it.
- Irreversibility. A blockchain transaction cannot be undone, and funds sent to the wrong address usually cannot be recovered.
- Regulatory uncertainty. Rules for DeFi are still taking shape in many countries.
In short
DeFi is an attempt to move trading, lending and other financial activities into open programs on a blockchain. That brings transparency and open access, but it also shifts responsibility for security onto the user. Understanding how a specific protocol works and what can go wrong with it matters more than knowing its name.