Foundations · Exchanges, DEX & DeFi

What Is DeFi?

DeFi, short for decentralized finance, is the collective name for financial services such as trading, lending and borrowing that run as smart contracts on public blockchains.

  • Beginner
  • 4 min read
  • Updated

Why it matters

DeFi is the word that ties this shelf together. Decentralized exchanges, liquidity pools, lending markets, staking tokens and some stablecoins are all described as parts of it.

The term is also used loosely, often as a marketing label. Knowing what it does and does not describe makes every other page here easier to read, and makes inflated claims easier to recognize.

How it works

The layers of a DeFi application
InterfaceA website or wallet screen. Convenient, replaceable, and able to be copied by a fake.
ProtocolsExchanges, lending markets, and some stablecoins. Each one runs on smart contracts, and some also depend on a company.
TokensWhat the protocols move: coins, stablecoins and receipt tokens.
BlockchainRuns the contract code and records every transaction.
A user touches the top layer. The funds are controlled by the layers underneath.

DeFi, short for decentralized finance, is a collective name for financial services that run as smart contracts on public blockchains. A smart contract is a program stored on the chain. It holds tokens and moves them according to its code when someone sends it a transaction.

A group of contracts that together provide one service is called a protocol. Users reach a protocol with a wallet. They do not open an account with a company, and in the simplest case no company holds their assets.

In plain words

Picture a row of vending machines in an empty hall. One swaps coins, one lends, one holds deposits. Each follows the rules printed inside it, and anyone can walk up and use them. There is no manager in the building, which is both the attraction and the problem.

What it is used for

Building block What it does Read more
Exchanges Swap one token for another from a wallet Decentralized exchanges
Liquidity pools Hold the tokens that swaps trade against AMMs and liquidity pools
Lending markets Lend deposited tokens to borrowers who post collateral DeFi lending and borrowing
Stablecoins Tokens designed to track a currency. Some are issued by companies holding reserves, others are created by contracts holding crypto collateral. Stablecoins
Staking tokens Tradable receipts for staked coins Staking

How it differs from traditional finance

The same service, built two ways
AspectTraditional financeDeFi
Who runs itA licensed companyCode on a public blockchain
Who holds the assetsThe institutionA smart contract, or the user's wallet
AccessAn account and identity checksA wallet and network fees
If something goes wrongSupport desk, regulator, courtsOften nobody with the power to undo it
Main dependencyThe institution stays solvent and honestThe code and everything it relies on works

The service on each side can look alike. The difference lies in what a user relies on. In traditional finance it is an institution, backed by law and supervision. In DeFi it is software, backed by whatever care went into writing it.

Going deeper

Composability

Composability: one holding, four protocols
  1. StakeDeposit a coin and receive a receipt token.
  2. Post collateralDeposit the receipt token in a lending protocol.
  3. BorrowTake a stablecoin loan against it.
  4. Supply a poolAdd the stablecoin to a liquidity pool.
Each step adds a dependency. A failure in any one of them can reach all the others.

Because protocols are public programs using shared token standards, the output of one can be the input of another. This is called composability. It allows new services to be assembled quickly. It also stacks risks: a position built from four protocols depends on all four, and on the tokens passed between them.

How decentralized is it?

Decentralization is a spectrum, not a label a project either has or lacks. Useful questions include who can upgrade or pause the contracts, who controls the price feeds, how concentrated the governance votes are, and who runs the website. A protocol can be open to everyone and still be controlled by a handful of key holders.

Where the rates come from

DeFi interfaces often display a yearly rate next to a deposit. The rate has a source: fees paid by traders, interest paid by borrowers, or new tokens issued by the protocol. Quoted rates are variable, are not guaranteed, are often paid in a token whose price can fall, and come with the risks of the mechanism producing them. APR and APY explains how the figures are built.

Size

The amount deposited across DeFi is usually reported as total value locked, a figure with its own limits.

Counting the dependencies in one hypothetical positionHypothetical illustration

Made-up numbers. A person holds 10 coins priced at 100 each, worth 1,000, and follows the four steps in the figure above: staking the coins, posting the receipt tokens as collateral, borrowing 400 of a stablecoin and adding it to a liquidity pool.

The position is still built on the same 1,000 of coins. It now depends on:

  1. the price of the coin;
  2. the staking protocol’s contracts;
  3. the market price of the receipt token;
  4. the lending protocol’s contracts and its liquidation rules;
  5. the stablecoin holding its value;
  6. the liquidity pool’s contracts.

That is six things that can go wrong, where simply holding the coins had one.

What it does NOT mean

  • DeFi does not mean no one is in control. Many protocols have administrators or large token holders who can change the rules.
  • “Decentralized” is not a safety rating. It describes how a service is run, not how well it is built.
  • A displayed rate is not income. It is a variable estimate attached to a risk-bearing position.
  • Open source does not mean checked. Code being public does not mean anyone qualified has read it.
  • Using DeFi does not place anyone outside the law. Tax and regulation still apply and differ by jurisdiction.

Common misunderstandings

  1. Treating DeFi as one thing. It is thousands of separate programs of very different quality.
  2. Confusing the website with the protocol. The interface is a convenience. The contracts are what hold the funds.
  3. Counting only the last step. In a stacked position, the weakest protocol in the chain sets the risk.
  4. Assuming mistakes can be undone. There is usually no party able to reverse a transaction or restore lost funds.

Risks and limits

  • Code risk. Bugs, exploits and unsafe upgrades can empty a protocol. See smart contract risk.
  • Token risk. Collateral, receipt tokens and stablecoins can all lose value quickly.
  • User error. A wrong address, a bad approval or a fake interface can cause a permanent loss.
  • Limited recourse. Consumer protections that apply to banks and brokers often do not apply.
  • Hidden reliance on companies. Stablecoin issuers, bridges and data providers bring counterparty risk back in.

Key takeaway

DeFi is finance rebuilt as public software on blockchains: open to anyone with a wallet, and dependent on the code instead of on an institution. That moves the risk. It does not remove it.

Sources and further reading