Section

DeFi

Financial services rebuilt as code on public blockchains — how they work and how they break.

Start with

  • What is DeFi?

    Financial services run by smart contracts: how they work, who controls them and where the risks hide.

    DeFi
    6 min readBeginner

What does the DeFi section cover?

DeFi means financial services run by smart contracts on public blockchains rather than by a bank or broker. ethereum.org presents it as an open alternative to traditional finance for lending, saving and trading. These explainers take each building block apart: how a decentralized exchange prices a swap, how lending pools set rates and liquidate loans, where liquidity providers’ returns and losses come from, and how oracles bring outside prices on-chain.

What is a sensible reading order?

  1. What is DeFi?
  2. How do decentralized exchanges work?
  3. Liquidity pools and impermanent loss
  4. How do DeFi lending and borrowing work?
  5. What is a blockchain oracle?
  6. What are the main risks of DeFi?, last, because it draws together the failure modes of every earlier page.

How does DeFi break?

  • Code exploits. A contract does exactly what its code says, including things its authors did not intend. The US Treasury’s 2023 risk assessment of DeFi describes thefts that exploit smart contract vulnerabilities and flash loan attacks.
  • Bad data. Lending markets rely on price feeds; the oracle explainer shows why a wrong price can trigger liquidations.
  • Fraud and weak controls. The same Treasury assessment lists rug pulls among DeFi scams and found that many DeFi services do not apply anti-money-laundering controls.
  • No safety net. ethereum.org acknowledges that Ethereum products, like any software, can suffer bugs and exploits, and the FDIC lists crypto assets among the products its deposit insurance does not cover.

Sources for this guide

Every explainer in DeFi

Terms used in this section

Glossary A–Z
  1. APR vs APY

    Simple rate versus compounded yield, with the official formula and a worked example.

  2. Depeg

    When a stablecoin slips from $1: causes, the 2023 USDC case and the UST collapse.

  3. Gas fee

    What you pay to get an Ethereum transaction processed, with the formula worked through.

  4. Rug pull

    When project creators raise money and disappear with it — how it works and the warning signs.

  5. Slippage

    Why a swap fills at a different price than quoted, and how slippage tolerance limits it.

Other layers of the stack

All sections