DeFi Explained
Understand decentralized finance — how it works, what you can do with it, and the risks involved
Listen to this module
What is DeFi?
DeFi (Decentralized Finance) is a system of financial services — lending, borrowing, trading, earning interest — that operates through smart contracts on a blockchain, with no banks, brokers, or intermediaries required.
In traditional finance (TradFi), a bank sits between every transaction: holding your deposits, approving your loans, executing your trades. DeFi replaces the bank with code. Smart contracts automatically enforce the rules, hold the funds, and execute transactions — 24/7, globally, without anyone's permission.
DeFi's core promise: anyone with an internet connection and a crypto wallet can access financial services that previously required a bank account, a credit score, and a physical address.
As of 2025, DeFi protocols hold over $100 billion in total value locked (TVL) — assets deposited into smart contracts across lending, trading, and yield platforms.
How DeFi Works
DeFi is built on programmable blockchains — primarily Ethereum, with significant activity on Solana, Avalanche, and BNB Chain.
The building blocks:
| Component | What it does | Example |
|---|---|---|
| Smart contracts | Self-executing code enforcing rules | Uniswap swap logic |
| Wallets | User's identity and asset storage | MetaMask, Phantom |
| Tokens | Assets traded and earned in DeFi | ETH, USDC, UNI |
| Protocols | Full DeFi applications | Aave, Compound, Uniswap |
| Oracles | Real-world price feeds into blockchain | Chainlink |
The typical DeFi workflow:
- Set up a self-custody wallet (MetaMask, Phantom)
- Fund it with crypto (ETH, USDC, SOL)
- Connect your wallet to a DeFi protocol
- Deposit, swap, lend, or borrow — all governed by smart contracts
- Withdraw your assets at any time; no approval needed
There are no accounts to open, no KYC forms to complete, and no business hours. DeFi protocols are permissionless — anyone can interact with them.
Decentralized Exchanges (DEX)
A DEX (Decentralized Exchange) allows users to trade cryptocurrencies directly from their wallets, without a centralized intermediary like Coinbase or Binance.
How they differ from centralized exchanges (CEX):
| Feature | CEX (Coinbase) | DEX (Uniswap) |
|---|---|---|
| Custody | Exchange holds your funds | You hold your funds |
| KYC required | Yes | No |
| Counterparty risk | Exchange can be hacked or fail | Smart contract risk only |
| Token selection | Limited, vetted | Any token can be listed |
| Availability | Business jurisdictions | Global, always on |
How DEX trading works — Automated Market Makers (AMMs): Traditional exchanges use order books. DEXes use liquidity pools — reserves of two tokens (e.g. ETH/USDC) contributed by liquidity providers. A mathematical formula (x × y = k) automatically sets the price based on the ratio in the pool.
When you swap ETH for USDC on Uniswap:
- Your ETH enters the ETH/USDC pool
- An equivalent value of USDC exits the pool
- The price adjusts based on the new ratio
- A small fee (0.05–1%) goes to liquidity providers
Major DEXes: Uniswap (Ethereum), Curve (stablecoins), Jupiter (Solana), PancakeSwap (BNB Chain)
Lending and Borrowing
DeFi lending protocols allow users to earn interest by depositing crypto, or borrow against their crypto holdings — all without a credit check.
How it works:
- Lenders deposit assets (e.g. USDC) into a lending pool and earn variable interest
- Borrowers provide collateral (e.g. ETH) worth more than their loan and borrow against it
- Liquidation occurs automatically if collateral value falls below a threshold
DeFi loans are overcollateralized — you must deposit more than you borrow. If you deposit $10,000 of ETH, you might borrow $6,000 of USDC. This protects lenders but limits capital efficiency.
Why would you borrow against crypto instead of selling?
- Avoid triggering a taxable event (selling crypto is taxable; borrowing is not)
- Maintain upside exposure to your crypto while accessing liquidity
- Leverage — use borrowed funds to increase exposure
Leading lending protocols:
| Protocol | Chain | Notable Feature |
|---|---|---|
| Aave | Ethereum, Polygon | Flash loans, rate switching |
| Compound | Ethereum | Pioneered DeFi lending |
| MakerDAO | Ethereum | Issues DAI stablecoin |
| Kamino | Solana | Solana-native lending |
Interest rates in DeFi are variable and set algorithmically based on supply and demand. When demand to borrow is high, rates rise; when low, rates fall.
Yield Farming and Liquidity
Yield farming is the practice of moving crypto assets across DeFi protocols to maximize returns. Liquidity provision is a core part of this — depositing tokens into DEX pools to earn trading fees.
Providing liquidity:
- Deposit an equal value of two tokens into a pool (e.g. $500 ETH + $500 USDC)
- Receive LP (Liquidity Provider) tokens representing your share
- Earn a portion of every trade fee in that pool
- Redeem LP tokens to withdraw your assets plus accumulated fees
Impermanent loss is the key risk of liquidity provision: When the price ratio between your two deposited tokens changes significantly, you end up with less value than if you had simply held them. The loss is "impermanent" because it reverses if prices return to original levels — but becomes permanent when you withdraw.
Yield farming strategies:
- Deposit stablecoins (USDC/USDT) to earn fees with near-zero impermanent loss
- Provide liquidity in correlated pairs (ETH/stETH) where prices move together
- Stack incentives — many protocols reward LPs with additional governance tokens
Annual yields in DeFi can range from 2% on stable pairs to 100%+ on new, risky protocols. High yields always come with high risk — unsustainable rates are usually a warning sign.
Staking
Staking means locking up cryptocurrency to support a blockchain network's operations and earn rewards in return. It is how Proof of Stake blockchains like Ethereum achieve security.
Types of staking:
Native staking — run a validator node to directly secure the network
- Ethereum: requires 32 ETH (~$80,000+) to run a full validator
- Earn ~3–5% APY in new ETH issuance
Liquid staking — stake without lockups, receive a liquid token in return
- Deposit ETH into Lido → receive stETH (staked ETH)
- stETH can be used in DeFi while still earning staking rewards
- Major protocols: Lido (stETH), Rocket Pool (rETH), Jito (Solana)
Exchange staking — stake through Coinbase, Binance, or Kraken
- Simplest option, but you give up custody
- Lower yields than native staking after platform fees
| Method | Yield | Complexity | Custody |
|---|---|---|---|
| Native staking | Highest | High | Self-custody |
| Liquid staking | High | Medium | Smart contract |
| Exchange staking | Lower | Low | Exchange |
DeFi Risks
DeFi offers significant opportunity but carries risks that do not exist in traditional finance:
Smart contract risk Code can have bugs. Billions of dollars have been lost to smart contract exploits. Even audited code is not immune — always check if a protocol has been audited and by whom.
Liquidation risk In lending protocols, if your collateral value drops, your position can be automatically liquidated — often at a loss. Volatile markets move fast.
Oracle manipulation DeFi protocols rely on price oracles. Attackers have manipulated oracle prices to drain lending pools via flash loan attacks.
Impermanent loss Providing liquidity to volatile pairs can result in worse returns than simply holding the assets.
Rug pulls and exit scams Anonymous developers can drain protocol funds and disappear. This is most common with new, unaudited protocols offering extremely high yields.
Regulatory risk DeFi operates in a legal grey zone. Regulators in the US and EU are actively developing frameworks that could restrict or require licensing for DeFi protocols.
User error Sent to the wrong address? Approved a malicious contract? There is no customer support. Transactions are irreversible.
A useful rule of thumb: never deposit into a DeFi protocol more than you could afford to lose entirely. Start with well-established protocols (Aave, Uniswap, Lido) before exploring newer, higher-yield alternatives.
Key Takeaways
- DeFi replaces financial intermediaries with smart contracts — enabling permissionless, global financial services
- DEXes use automated market makers (AMMs) and liquidity pools instead of order books
- Lending protocols allow users to earn interest on deposits or borrow against crypto collateral — no credit check required
- Yield farming involves moving assets between protocols to maximize returns; impermanent loss is the key risk
- Liquid staking (Lido, Rocket Pool) lets users earn staking rewards while keeping assets usable in DeFi
- Smart contract bugs, liquidations, oracle manipulation, and rug pulls are DeFi-specific risks
- Start with established, audited protocols; never deposit more than you can afford to lose entirely
Continue your learning journey
Explore our other modules to deepen your financial knowledge.
Browse All Modules →