ArbTide

What Is DeFi? Decentralized Finance Explained With Examples

DeFi (decentralized finance) is trading, lending and borrowing run by smart contracts, not banks. Learn how DEXs, lending and perp DEXs work, plus the risks.

Updated

DeFi, short for decentralized finance, is a set of financial services, such as trading, lending, borrowing and derivatives, that run on blockchain smart contracts instead of through banks or exchange companies. Users connect a self-custody wallet and interact with public code directly. Anyone with a wallet can use most DeFi apps, and anyone can inspect how they work.

Key takeaways

  • DeFi runs on smart contracts, programs on blockchains such as Ethereum.
  • You keep custody of your funds in your own wallet until you deposit them into a contract.
  • Core services are DEXs, lending markets, stablecoins and perp DEXs.
  • DeFi loans are overcollateralized and enforced by automatic liquidations.
  • Protocols can plug into each other, a property called composability.
  • Key risks are smart contract bugs, oracle failures and liquidation.

How DeFi works

A smart contract is code deployed on a blockchain that holds funds and follows fixed rules. When you use a DeFi app, you sign a transaction from your crypto wallet that calls the contract. The contract executes the same way for everyone, and the result is recorded on-chain.

Three features make DeFi different from traditional finance:

  1. Self-custody: no company holds your assets on your behalf.
  2. Open access: most protocols do not require an account or identity check at the contract level, although website front ends may restrict some regions.
  3. Composability: one protocol can use another's tokens and contracts as building blocks. A token received from a lending market can be traded on a DEX or used as collateral somewhere else.

Main DeFi services

Service What it does How prices or rates are set
Decentralized exchanges (DEXs) Swap one token for another from your wallet Liquidity pool formulas or on-chain order books
Lending markets Deposit assets to earn interest, or borrow against collateral Rates rise as more of the pool is borrowed
Stablecoins Tokens that track a currency such as the US dollar Reserves, collateral or other mechanisms
Perp DEXs Trade perpetual futures on-chain Order books or pools, with funding rates
Liquid staking Stake coins and receive a tradable token in return Tracks the staked asset plus rewards

Many DEXs use automated market makers (AMMs), pools holding two tokens. A basic constant-product pool keeps x × y = k, where x and y are the pool's token balances, so the price moves as traders buy and sell. The people who deposit tokens into these pools are liquidity providers, and they earn a share of trading fees. See CEX vs DEX for how DEXs compare with centralized exchanges.

Stablecoins are the base currency of most DeFi activity, used for trading pairs, lending and collateral.

Worked example: a DeFi loan

DeFi lenders cannot run credit checks, so loans are secured with more collateral than the amount borrowed. Assume a lending market with these settings for ETH collateral:

  • Maximum loan-to-value (LTV): 75%. You can borrow up to 75% of your collateral's value.
  • Liquidation threshold: 80%. If debt exceeds 80% of collateral value, the position can be liquidated.

You deposit 5 ETH at $2,000, so your collateral is worth 5 × $2,000 = $10,000. You borrow $6,000 in stablecoins, a 60% LTV.

Many protocols track a health factor:

Health factor = collateral value × liquidation threshold ÷ debt

  • At the start: $10,000 × 0.80 ÷ $6,000 = 1.33. Above 1 is safe.
  • ETH falls 25% to $1,500. Collateral = 5 × $1,500 = $7,500. Health factor = $7,500 × 0.80 ÷ $6,000 = 1.00.

At a health factor of 1, liquidators can repay part of your debt and take some of your collateral, usually with a bonus paid out of it. The collateral liquidated can be worth more than the debt repaid, which is a loss for you. This works like liquidation on a leveraged exchange position, but it is enforced by code rather than by an exchange's risk engine.

Risks of DeFi

  • Smart contract risk: a bug or design flaw can let attackers drain funds. Audits reduce this risk but do not remove it.
  • Oracle risk: protocols read prices from oracles, services that bring off-chain data on-chain. A wrong or manipulated price can trigger unfair liquidations.
  • Impermanent loss: liquidity providers can end up with less value than if they had simply held the two tokens, when prices move apart. The impermanent loss calculator shows how much.
  • Liquidation risk: borrowers can lose collateral quickly in fast markets.
  • Approval and phishing risk: signing a malicious transaction or token approval can empty a wallet.
  • Stablecoin and bridge risk: a stablecoin can lose its peg, and bridges between chains have been frequent attack targets.
  • Gas costs: on busy networks, fees can outweigh the benefit of small transactions.

A common mistake is judging a protocol only by its advertised yield. High yields often reflect high risk or temporary token rewards.

DeFi and arbitrage

Because DEX prices are set by pool balances and on-chain order books, they can drift away from prices on centralized exchanges. Arbitrage traders buy on one side and sell on the other, which pulls prices back together. Perp DEXs also pay funding rates that can differ from centralized venues, often on hourly intervals.

For example, assume a token trades at $1.000 on a centralized exchange and $1.010 in a DEX pool, a 1% gap. On a $2,000 trade, that is $20 of gross edge. From it you must subtract the pool fee, the price impact of your own swap (which moves the pool price toward the CEX price), gas, and the taker fee on the centralized side. If those add up to, say, $14, the net profit is $20 − $14 = $6. The gap closes as arbitrage traders act on it, which is how DEX prices stay aligned with the wider market.

How ArbTide helps

ArbTide includes perp DEXs alongside centralized exchanges on the live funding rates page, with rates normalized to APR. For trades between on-chain and centralized markets, see the CEX-DEX arbitrage strategy.

Frequently asked questions

What is DeFi in simple terms?
DeFi, short for decentralized finance, is a set of financial services such as trading, lending and borrowing that run on blockchain smart contracts. Users connect a self-custody wallet and interact with the code directly instead of going through a bank or exchange company.
How is DeFi different from a centralized exchange?
On a centralized exchange, a company holds your funds and runs the trading system. In DeFi, you keep custody in your own wallet, and smart contracts execute trades and loans according to public rules.
How do DeFi loans work without credit checks?
DeFi loans are overcollateralized: you deposit more value than you borrow. If your collateral falls in value and the loan becomes too risky, the protocol lets others liquidate part of the collateral to repay the debt.
What are the main risks of DeFi?
The main risks are smart contract bugs, oracle failures or manipulation, liquidation of borrowed positions, impermanent loss for liquidity providers, phishing and malicious token approvals, and high gas fees during busy periods.
What is TVL in DeFi?
TVL, or total value locked, is the market value of all assets deposited in a DeFi protocol's smart contracts. It is a rough gauge of how much capital a protocol holds, but it moves with token prices and can count the same funds more than once.

Related guides