AdvertiseFee Deal Desk

GlossaryConcept

DeFi (Decentralized Finance): What It Is and How It Works

DeFi (decentralized finance) is a set of financial services, such as trading, lending and borrowing, that run as smart contracts on public blockchains instead of through banks or brokers. Anyone with a crypto wallet can use them, and the code, not a company, enforces the rules.

By COINOTAG Research DeskLast updated Sources

binance.com

How DeFi works

A DeFi application is a set of smart contracts deployed on a blockchain such as Ethereum. The contract holds the funds and the rules: who may deposit, how much can be borrowed against what collateral, what price a swap executes at. Users interact with it directly from a self-custody wallet by signing transactions, and every action is recorded on the public ledger.

Five building blocks appear in almost every DeFi service:

gate.com
  1. Smart contracts hold deposits and execute the protocol's rules automatically.
  2. Wallets hold the user's private keys and sign each interaction; no account or sign-up is needed.
  3. Stablecoins give the system a dollar-denominated unit for prices, loans and savings.
  4. Liquidity pools are shared pots of tokens that traders swap against and borrowers draw from. People who deposit into them earn a share of fees or interest.
  5. Oracles bring outside data, most importantly market prices, onto the chain so contracts can value collateral.

Because every protocol is public code on the same ledger, one protocol can plug into another. A token received from a lending market can be used as collateral somewhere else or traded on a decentralized exchange. This is called composability, and it is why DeFi is often described as "money legos". It is also why a failure in one protocol can spread to the ones built on top of it.

Each interaction costs a network fee, the gas fee on Ethereum, which is why much DeFi activity has moved to cheaper layer 2 networks and to other smart-contract chains such as Solana.

mexc.com

A composed workflow (hypothetical, no rates): a user deposits USDC into a lending market and receives an interest-bearing receipt token. They use that receipt as collateral to borrow a different stablecoin, and deposit it into a liquidity pool that earns trading fees. Each step is a transaction signed from one wallet, with no sign-up and at any hour; but each step also adds a smart-contract risk, a price-oracle dependency and a possible liquidation if collateral values fall. Oracle networks such as Chainlink supply most of those price feeds.

Liquidity providers in automated market makers also face impermanent loss: when the prices of the two pooled tokens move apart, the provider can end up with less value than if they had simply held the tokens.

Main types of DeFi protocols

CategoryWhat it doesTypical mechanism
Decentralized exchanges (DEX)Swap one token for another without an order-matching companyAutomated market maker pools or on-chain order books
Lending and borrowingDeposit tokens to earn interest, or borrow against collateralOver-collateralized loans with automatic liquidation
StablecoinsKeep a token close to $1Crypto collateral locked in contracts, or reserves held off-chain
DerivativesTrade leveraged or synthetic exposureOn-chain perpetual contracts, options
Liquid stakingStake a chain's coin and receive a tradable receipt tokenPooled staking
Yield aggregatorsMove deposits between protocols to chase returnsAutomated strategies (yield farming)

Most protocols are steered by a governance token whose holders vote on parameters such as interest-rate models, fees and which assets are accepted as collateral. Some are organised as a DAO.

A short history of DeFi

DeFi grew out of Ethereum, the first widely used blockchain that could run general-purpose programs. Its early landmarks were MakerDAO, whose DAI stablecoin is created by locking crypto as collateral, and Uniswap, which popularised the automated market maker: a pool that quotes prices from a formula instead of matching buyers and sellers.

Lending markets such as Compound and Aave followed. The period crypto users call "DeFi summer" began when Compound started distributing its COMP governance token to people who used the protocol. Other projects copied the idea, deposits poured in, and "yield farming" became common vocabulary.

Later phases brought DeFi to many other chains and layer 2 networks, added on-chain derivatives, liquid staking and restaking, and began to put tokenized real-world assets such as government bonds on-chain. They also brought painful lessons: the collapse of the algorithmic stablecoin TerraUSD, large thefts from cross-chain bridges and repeated smart-contract exploits showed how quickly losses can spread through composable systems.

A few more markers of that history:

  • 2021: DeFi spread to other layer 1s such as Solana and Avalanche, and on-chain derivatives protocols such as dYdX and GMX grew.
  • 2022–2023: besides Terra's collapse and bridge hacks, a bug in some versions of the Vyper compiler led to exploits of several Curve pools in July 2023, a reminder that risk can sit below the protocol's own code.
  • 2024 onward: restaking, tokenized real-world assets (RWAs), "intent"-based designs, in which users state the outcome they want and solvers compete to deliver it, and growing institutional use.

How DeFi is measured: TVL

The most common size metric is total value locked (TVL): the market value of all tokens deposited in a protocol's contracts. Aggregators such as DefiLlama add it up per protocol and per chain.

TVL is useful for comparing protocols but has limits. It moves with token prices even when nobody deposits or withdraws, and the same dollar can be counted twice when a receipt token from one protocol is deposited into another. Revenue, fees paid and active users give a fuller picture. Live figures change by the minute, so they belong on a data page, not in a definition.

DeFi vs traditional finance

DeFiTraditional finance
AccessAnyone with a wallet, any timeAccount opening, identity checks, business hours for some services
CustodyUser holds their own keysBank or broker holds the assets
RulesPublic code, changed by governance votesContracts, internal policies, regulation
TransparencyEvery transaction and balance is publicBooks are private and audited periodically
RecourseUsually none if funds are lost or stolenDeposit insurance, courts, complaint procedures
Identity checksRare at protocol levelKYC is standard

Many people reach DeFi through a centralized exchange first, buying tokens there and then moving them to a self-custody wallet.

Risks of DeFi

  • Smart-contract bugs. A flaw in the code can let an attacker drain funds. Audits reduce but do not remove this risk.
  • Oracle manipulation. If a protocol reads a price that can be pushed around, for example with a flash loan, attackers can borrow against inflated collateral.
  • Liquidation. Borrowers whose collateral falls in value are liquidated automatically, often with a penalty.
  • Stablecoin depegs. A stablecoin that loses its peg can break every protocol that treats it as worth $1.
  • Impermanent loss. Liquidity providers can end up worse off than if they had simply held the two tokens, when their prices diverge.
  • Scams and admin keys. Some projects keep the power to change contracts or mint tokens, and some are outright rug pulls.
  • Regulation. Rules for DeFi differ by country and are still developing.

Advertised yields, shown as APY, change constantly and reflect these risks. Independent research (DYOR) and checking who controls a protocol's contracts are basic precautions.

Frequently Asked Questions

6 questions
What does DeFi stand for?

DeFi stands for decentralized finance: financial services such as trading, lending and borrowing that run as smart contracts on public blockchains, without a bank or broker in the middle.

How does DeFi work?

Users connect a self-custody wallet to a protocol's smart contracts and sign transactions to deposit, swap or borrow. The contract holds the funds and applies its rules automatically, and every action is recorded on the blockchain.

Is DeFi the same as a crypto exchange?

No. A centralized exchange is a company that holds customer funds and matches orders. A DeFi exchange (DEX) is a set of smart contracts: users keep custody of their tokens until the moment they trade, and no company holds their account.

Which blockchains is DeFi built on?

Ethereum was the first major DeFi platform and still hosts many of the largest protocols, together with its layer 2 networks. DeFi also runs on other smart-contract chains such as Solana and BNB Chain.

What is TVL in DeFi?

TVL, or total value locked, is the market value of the tokens deposited in a protocol's smart contracts. It is the most common way to compare the size of DeFi protocols, but it moves with token prices and can double-count reused deposits.

What are the main risks of DeFi?

The main risks are smart-contract bugs and exploits, price-oracle manipulation, automatic liquidation of loans, stablecoin depegs, impermanent loss for liquidity providers, fraudulent projects and changing regulation. Losses are usually not recoverable.