Skip to main content
Loading...

DeFi (Decentralized Finance) Basics

Learn how decentralized finance is reshaping traditional banking and investing. Understand DeFi protocols, lending, yield farming, staking, and the risks you need to know before participating.

What Is DeFi?

Decentralized finance (DeFi) refers to a broad category of financial applications and protocols built on blockchain networks that operate without traditional intermediaries such as banks, brokerages, or insurance companies. Instead of relying on centralized institutions to facilitate transactions, DeFi uses smart contracts -- self-executing code deployed on blockchains -- to automate financial services like lending, borrowing, trading, and earning interest.

The core premise of DeFi is straightforward: any financial service that exists in the traditional banking system can be rebuilt as an open, permissionless, and transparent protocol on a blockchain. Anyone with an internet connection and a cryptocurrency wallet can access DeFi services, regardless of their location, credit history, or banking status. This stands in stark contrast to traditional finance, where access often requires identity verification, minimum balances, and approval from gatekeepers.

DeFi emerged primarily on the Ethereum blockchain beginning around 2018-2019, leveraging Ethereum's programmable smart contract capabilities. While Ethereum remains the dominant DeFi ecosystem, protocols have since expanded to other blockchains including Solana, Avalanche, Arbitrum, and BNB Chain, each offering different tradeoffs in speed, cost, and security.

How DeFi Works

Understanding how DeFi operates requires familiarity with three foundational concepts: smart contracts, protocols, and composability.

Smart Contracts

Smart contracts are programs stored on a blockchain that execute automatically when predetermined conditions are met. In DeFi, smart contracts replace the functions traditionally performed by banks and financial institutions. For example, a lending smart contract automatically manages collateral deposits, calculates interest rates based on supply and demand, and liquidates undercollateralized positions -- all without any human intervention.

Once deployed, smart contracts are generally immutable, meaning their code cannot be changed. This provides transparency since anyone can audit the code, but it also means that bugs or vulnerabilities in the code cannot be easily patched, which introduces unique risks discussed later in this guide.

Protocols

A DeFi protocol is a set of smart contracts that work together to provide a specific financial service. For instance, Aave is a lending protocol consisting of many interconnected smart contracts that handle deposits, loans, interest calculations, and liquidations. Uniswap is a trading protocol with smart contracts that manage liquidity pools and facilitate token swaps. Each protocol typically has its own governance token that allows holders to vote on protocol upgrades and parameter changes.

Composability

Composability is one of DeFi's most powerful features. Because DeFi protocols are open-source and built on public blockchains, they can interact with each other seamlessly. Developers can build new applications that combine multiple existing protocols, creating complex financial products from simple building blocks. This interconnectedness accelerates innovation but also creates systemic risk -- if one foundational protocol fails, it can cascade through every protocol built on top of it.

Key DeFi Categories

The DeFi ecosystem encompasses several major categories of financial services, each serving distinct purposes and carrying different risk profiles.

Lending and Borrowing

DeFi lending protocols allow users to deposit cryptocurrency and earn interest, or borrow assets by providing collateral. Unlike traditional bank loans, DeFi lending is overcollateralized -- borrowers must deposit more value than they borrow, typically 150% or more of the loan value. If the collateral value drops below the required ratio, the position is automatically liquidated by the smart contract.

Major lending protocols include Aave and Compound, which together have facilitated billions of dollars in loans. Interest rates in DeFi are determined algorithmically by supply and demand: when borrowing demand is high, rates increase to attract more depositors, and vice versa. This creates a dynamic, market-driven interest rate system that adjusts in real time.

Decentralized Exchanges (DEXs)

Decentralized exchanges allow users to trade cryptocurrencies directly with each other without a centralized order book or custodian. The most common DEX design uses an automated market maker (AMM) model, where trades are executed against liquidity pools rather than matched with other traders. Uniswap, the largest DEX, pioneered this model.

In an AMM, liquidity providers deposit pairs of tokens into pools and earn trading fees from every swap. The price of tokens in the pool is determined by a mathematical formula based on the ratio of assets in the pool, not by order matching. This model provides continuous liquidity but introduces the concept of impermanent loss for liquidity providers.

Stablecoins

Stablecoins are cryptocurrencies designed to maintain a stable value, typically pegged to the US dollar. They serve as the backbone of DeFi, providing a stable unit of account for lending, borrowing, and trading. There are several types of stablecoins:

  • Fiat-backed (USDC, USDT): Backed by actual dollars held in reserve by a centralized issuer
  • Crypto-backed (DAI): Backed by overcollateralized cryptocurrency deposits in smart contracts
  • Algorithmic: Use algorithms and incentive mechanisms to maintain their peg without direct collateral backing (these have proven risky, as demonstrated by the Terra/UST collapse)

Yield Farming

Yield farming involves strategically moving assets between different DeFi protocols to maximize returns. Protocols often incentivize usage by distributing their governance tokens to users, creating additional yield opportunities beyond standard interest or trading fees. Yield farming can produce high returns but involves significant complexity and risk, as discussed in detail below.

Liquid Staking

Liquid staking allows users to stake proof-of-stake assets like Ethereum while receiving a liquid token that represents their staked position. This liquid token can then be used elsewhere in DeFi, allowing users to earn staking rewards while simultaneously participating in lending or liquidity provision. Lido is the largest liquid staking protocol, issuing stETH tokens that represent staked Ethereum.

DeFi vs Traditional Finance

Understanding the fundamental differences between DeFi and traditional finance helps investors assess where DeFi adds genuine value and where it introduces new risks.

Feature Traditional Finance DeFi
Access Requires bank account, ID verification, credit checks Open to anyone with a crypto wallet and internet
Intermediaries Banks, brokers, clearinghouses process transactions Smart contracts execute transactions automatically
Operating Hours Business hours, market hours, settlement delays 24/7/365 with near-instant settlement
Transparency Internal records, periodic disclosures, audited statements All transactions and code publicly visible on-chain
Regulation Extensive regulatory framework, consumer protections Limited regulation, few consumer protections
Fees Account fees, commissions, wire transfer fees Gas fees (transaction costs), protocol fees
Custody Institution holds your assets You control your own assets (self-custody)
Insurance FDIC, SIPC protections for depositors No government insurance; optional DeFi insurance protocols

Total Value Locked (TVL)

Total Value Locked (TVL) is the primary metric used to measure the size and adoption of DeFi. TVL represents the total amount of cryptocurrency deposited into DeFi protocols, including funds in lending pools, liquidity pools, staking contracts, and other smart contracts. It functions similarly to "assets under management" in traditional finance.

TVL is useful for gauging the overall health and growth of the DeFi ecosystem, but it has limitations. TVL can be inflated through recursive borrowing (depositing collateral, borrowing against it, then redepositing), and it fluctuates with cryptocurrency prices even if no new capital enters or leaves the system. When evaluating individual protocols, comparing TVL trends over time is more informative than looking at a single snapshot.

Popular DeFi Protocols

The DeFi landscape is constantly evolving, but several protocols have established themselves as foundational infrastructure. The following table provides an overview of well-known DeFi protocols across different categories.

Protocol Category Primary Chain Description
Aave Lending/Borrowing Ethereum, multi-chain Overcollateralized lending with flash loans and variable/stable rates
Uniswap DEX (AMM) Ethereum, multi-chain Automated market maker for token swaps using liquidity pools
Lido Liquid Staking Ethereum Liquid staking for ETH; issues stETH tokens representing staked positions
MakerDAO Stablecoin/Lending Ethereum Issues DAI stablecoin through overcollateralized vaults
Compound Lending/Borrowing Ethereum Algorithmic interest rate protocol for supplying and borrowing assets
Curve Finance DEX Ethereum, multi-chain Optimized for stablecoin and similar-asset swaps with low slippage
Eigenlayer Restaking Ethereum Allows staked ETH to secure additional protocols through restaking

Yield Farming and Liquidity Provision

Yield farming is the practice of deploying cryptocurrency assets across various DeFi protocols to generate the highest possible return. At its core, yield farming involves providing liquidity or capital to a protocol in exchange for rewards, which may include interest payments, trading fees, and governance token distributions.

How Liquidity Provision Works

When you provide liquidity to a DEX like Uniswap, you deposit an equal value of two tokens into a liquidity pool (for example, ETH and USDC). Traders who swap between these tokens pay a fee, and a portion of those fees is distributed proportionally to liquidity providers based on their share of the pool. In addition, many protocols distribute their own governance tokens to liquidity providers as an extra incentive, a practice known as "liquidity mining."

APY vs APR

DeFi protocols report yields in two ways. APR (Annual Percentage Rate) represents the simple annual return without accounting for compounding. APY (Annual Percentage Yield) includes the effect of compounding, which can make the same underlying rate appear significantly higher. A protocol advertising a 50% APY may have a much lower APR. Always check which metric a protocol is reporting and whether the yield is sustainable or temporarily inflated by token incentives.

Impermanent Loss

Impermanent loss is a risk unique to liquidity providers in AMM-based DEXs. It occurs when the price ratio of the two tokens in your liquidity pool changes relative to when you deposited them. The greater the price divergence, the larger the impermanent loss. If one token doubles in price relative to the other, a liquidity provider would have been better off simply holding both tokens rather than providing liquidity.

The loss is called "impermanent" because it reverses if prices return to their original ratio. However, if you withdraw your liquidity while prices have diverged, the loss becomes permanent. Trading fees earned from the pool can offset impermanent loss, but in high-volatility pairs, impermanent loss frequently exceeds the fees earned.

Staking in DeFi

Staking in DeFi generally refers to locking up cryptocurrency to support the operation of a blockchain network and earning rewards in return. On proof-of-stake blockchains like Ethereum, validators must stake a minimum amount of cryptocurrency (32 ETH for Ethereum) to participate in block validation and earn staking rewards.

Validator Staking

Running a validator node requires technical expertise and a significant capital commitment. Validators are responsible for proposing and attesting to new blocks. In return, they earn staking rewards funded by newly issued tokens and transaction fees. However, validators who behave maliciously or go offline risk having their staked funds "slashed" -- a penalty mechanism that destroys a portion of their stake.

Liquid Staking

Liquid staking protocols like Lido and Rocket Pool allow users to stake any amount of ETH without running their own validator. When you stake through Lido, you receive stETH tokens on a 1:1 basis. These stETH tokens accrue staking rewards automatically and can be used as collateral in other DeFi protocols, effectively allowing you to earn staking rewards and DeFi yields simultaneously.

Liquid staking has become the largest category of DeFi by TVL. However, it introduces additional layers of risk: smart contract risk from the liquid staking protocol itself, potential depeg risk if the liquid staking token trades below the value of the underlying staked asset, and centralization concerns if a single liquid staking provider controls too large a share of the network's staked tokens.

Risks of DeFi

DeFi offers innovative financial services, but it carries significant risks that every participant must understand. Unlike traditional finance, there is no customer support to call, no FDIC insurance, and no regulatory body to file complaints with if something goes wrong.

Smart Contract Risk

The most fundamental risk in DeFi is that the code governing a protocol may contain bugs or vulnerabilities. Even audited smart contracts have been exploited, resulting in hundreds of millions of dollars in losses. Since smart contracts are immutable, a bug cannot simply be patched -- it often requires deploying an entirely new contract and migrating users. Before depositing significant capital into any protocol, check whether it has undergone multiple independent security audits and whether it has a bug bounty program.

Rug Pulls and Scams

A rug pull occurs when the creators of a DeFi protocol withdraw all deposited funds and disappear. This is most common with new, unaudited protocols that promise extremely high returns to attract deposits quickly. Warning signs include anonymous teams, unaudited code, locked liquidity periods that are suspiciously short or nonexistent, and aggressive marketing focused on guaranteed returns.

Regulatory Risk

Governments worldwide are actively working to regulate DeFi. Regulatory actions could require protocols to implement KYC (know your customer) requirements, could classify certain DeFi tokens as securities, or could restrict access to DeFi services in certain jurisdictions. Regulatory uncertainty creates ongoing risk for DeFi participants, as the legal landscape can shift quickly and significantly.

Oracle Manipulation

Oracles are services that feed external data (such as asset prices) to smart contracts. If an oracle is compromised or manipulated, it can trigger incorrect liquidations, enable price manipulation attacks, or cause protocols to miscalculate interest rates. Oracle manipulation has been the attack vector in numerous high-profile DeFi exploits.

Systemic and Composability Risk

Because DeFi protocols are interconnected, a failure in one protocol can cascade through the entire ecosystem. If a major lending protocol is exploited, it can cause collateral liquidations that crash token prices, which in turn triggers liquidations in other protocols, creating a chain reaction. The composability that makes DeFi innovative also makes it fragile in times of stress.

How to Get Started with DeFi

If you understand the risks and want to explore DeFi, follow these steps to get started safely.

1. Set Up a Non-Custodial Wallet

DeFi requires a self-custody wallet that you control. Popular options include MetaMask (browser extension and mobile app) for Ethereum-based DeFi, and Phantom for Solana. Write down your seed phrase on paper and store it securely -- if you lose your seed phrase, you permanently lose access to your funds. Never share your seed phrase with anyone or enter it on any website.

2. Acquire Cryptocurrency

Purchase cryptocurrency on a centralized exchange like Coinbase or Kraken, then transfer it to your non-custodial wallet. You will need the native token of whatever blockchain you plan to use (ETH for Ethereum, SOL for Solana) to pay transaction fees (gas). Start with a small amount while you learn the mechanics.

3. Bridge Assets if Needed

If you want to use DeFi on Layer 2 networks (like Arbitrum or Optimism) or alternative blockchains, you may need to bridge your assets from the main chain. Use only well-established bridges and be aware that bridging introduces additional smart contract risk. Official bridges maintained by the Layer 2 teams are generally the safest option.

4. Start Small and Simple

Begin with straightforward activities like depositing stablecoins into a well-established lending protocol or staking ETH through a liquid staking provider. Avoid complex yield farming strategies, leveraged positions, or obscure protocols until you have significant experience. Understand exactly what you are doing with each transaction before confirming it.

5. Practice Security Hygiene

DeFi self-custody means you are solely responsible for your security. Use a hardware wallet for large amounts, verify contract addresses before interacting with protocols, revoke token approvals for contracts you no longer use, and be extremely cautious of phishing sites that mimic legitimate DeFi protocols. Bookmark the official URLs of protocols you use regularly.

DeFi and Taxes

DeFi transactions can create complex tax obligations that many participants overlook. In most jurisdictions, the following DeFi activities are taxable events:

  • Token swaps on DEXs -- each swap is typically a taxable disposal of one asset and acquisition of another
  • Earning interest or yield -- lending interest, staking rewards, and liquidity mining rewards are generally treated as income
  • Providing and withdrawing liquidity -- may trigger capital gains depending on your jurisdiction's treatment of LP tokens
  • Claiming governance token rewards -- typically taxed as income at the fair market value at the time of receipt
  • Bridging across chains -- some jurisdictions may treat cross-chain bridging as a taxable event

The sheer volume and complexity of DeFi transactions makes tax reporting extremely challenging. Consider using specialized crypto tax software that can track DeFi transactions across protocols and chains. Consult a tax professional familiar with cryptocurrency before engaging in significant DeFi activity, as the tax implications can be substantial and the rules vary significantly between jurisdictions.

Frequently Asked Questions About DeFi

DeFi carries significant risks for all participants, but beginners face additional risks due to unfamiliarity with wallet management, transaction signing, and smart contract interaction. Common beginner mistakes include sending assets to the wrong address, falling for phishing sites, granting unlimited token approvals, and not understanding impermanent loss. If you decide to explore DeFi, start with very small amounts on well-established protocols with strong audit histories, and take time to learn the mechanics before committing meaningful capital.

Regular crypto investing typically involves buying and holding cryptocurrencies on a centralized exchange, similar to buying stocks through a brokerage. DeFi goes further by allowing you to actively use your crypto assets within financial protocols -- lending them out for interest, providing liquidity for trading, staking for network rewards, or borrowing against them. DeFi offers more ways to generate returns but requires self-custody of assets, direct interaction with smart contracts, and a deeper understanding of the underlying mechanisms and risks.

Yes, total loss is possible in DeFi. Smart contract exploits can drain all funds from a protocol. Rug pulls by dishonest developers can result in complete loss. Extreme market volatility can trigger cascading liquidations. Unlike bank deposits protected by FDIC insurance or brokerage accounts protected by SIPC, there is no government safety net for DeFi losses. Some DeFi insurance protocols exist (like Nexus Mutual), but coverage is limited and not equivalent to traditional financial protections. Only participate with funds you can genuinely afford to lose entirely.

There is no minimum deposit required for most DeFi protocols, but transaction fees (gas) can make small transactions impractical. On Ethereum mainnet, a single transaction can cost $5-$50 or more depending on network congestion, making it unsuitable for small amounts. Layer 2 networks like Arbitrum and Optimism reduce transaction costs significantly, often to under $0.50, making DeFi accessible with smaller amounts. For learning purposes, starting with $50-$200 on a Layer 2 network is reasonable. Regardless of your total crypto holdings, never deploy more into DeFi than you can afford to lose completely.

The legality of DeFi varies by jurisdiction and is evolving rapidly. In most Western countries, using DeFi protocols is currently legal, though participants are required to report income and capital gains for tax purposes. However, some countries have banned or restricted cryptocurrency use entirely, which would include DeFi. Regulatory agencies in the US, EU, and other regions are actively developing frameworks that may impose requirements on DeFi protocols, such as KYC compliance. Before participating in DeFi, research the specific regulations in your jurisdiction and consult a legal professional if you are unsure about your obligations.

Continue Learning

Explore related investment topics to expand your knowledge.

Pavlo Pyskunov

Written By

Pavlo Pyskunov

Reviewed for accuracy

Finance educator and founder of InvestmentBasic. Passionate about making investment education accessible to everyone, with a focus on practical, beginner-friendly content backed by data.

Start typing to search across all investment topics...

Request an AI summary of InvestmentBasic