QTube LearnDeFi and markets Beginner

DeFi

Decentralized finance is a loose label for lending markets, exchanges, stablecoin systems, derivatives, asset managers and related applications that settle on public ledgers. Many of them are smart-contract protocols: they hold assets, update balances and liquidate positions when called. They exist on Ethereum, Solana and many other chains; they are not an Ethereum-only phenomenon. Composability lets one protocol use another in the same transaction. That is useful and contagious. Risks include smart-contract bugs, oracle failure, thin liquidity, admin keys, governance capture and ordinary market moves. This article is a map, not a product recommendation.

Published
Last reviewed

In brief

Decentralized finance is a loose label for lending markets, exchanges, stablecoin systems, derivatives, asset managers and related applications that settle on public ledgers. Many of them are smart-contract protocols: they hold assets, update balances and liquidate positions when called. They exist on Ethereum, Solana and many other chains; they are not an Ethereum-only phenomenon. Composability lets one protocol use another in the same transaction. That is useful and contagious. Risks include smart-contract bugs, oracle failure, thin liquidity, admin keys, governance capture and ordinary market moves. This article is a map, not a product recommendation.

What the term covers

ethereum.org describes DeFi as financial products accessible to anyone who can use Ethereum. That is an Ethereum-site framing. The same kinds of applications exist on other programmable chains, and some “DeFi” activity is only loosely on-chain (off-chain order books with on-chain settlement, for example).

A more careful definition: DeFi is the set of systems that try to provide financial functions — transfer, exchange, lending, collateral, derivatives, insurance-like payouts, fundraising — using public ledgers and, usually, shared programs rather than a single firm’s private database.

Bitcoin already did one of those functions: transfer of a native asset without a mint as a trusted third party. Later systems added programmable conditions. Calling Bitcoin “the first DeFi application,” as some Ethereum pages do, is a historical flourish. Bitcoin is electronic cash with a limited script. DeFi as commonly discussed is the later stack of applications.

The term hides variety:

  • fully on-chain automated market makers;
  • lending pools with on-chain collateral and off-chain interfaces;
  • protocols with a multisig that can pause or upgrade everything;
  • protocols whose contracts are immutable but whose website can be seized;
  • products that look on-chain but custody assets with a company.

“Decentralized” can describe different layers differently. A protocol can have public contracts and a single admin key. It can have token voting and a five-person council that actually moves the treasury. It can be non-custodial at the contract and fully custodial at the website.

How a typical protocol is put together

Think in layers, following ethereum.org’s useful split and keeping it chain-agnostic:

  1. Ledger. Ethereum, Solana, a rollup, or another chain records balances and contract state.
  2. Assets. A native coin (ETH, SOL, BTC) and tokens (ERC-20s, SPL tokens, and others). These are not one technical standard.
  3. Protocols. Programs that implement a market: a pool, a lending book, a vault.
  4. Applications. Websites, wallets and bots that build transactions for those programs.

A user usually sees layer 4 and signs for layer 1. Connecting a wallet is not the same as authorizing a spend. Authorization is the signature (or session permission) on a specific transaction.

On Ethereum, a protocol is typically one or more contracts. On Solana, it is typically a program plus many data accounts. The financial idea can be similar; the objects are not.

Lending and borrowing

Two common patterns, described on ethereum.org and used far beyond that site:

  • Peer-to-peer. A specific lender and borrower are matched.
  • Pool-based. Lenders deposit into a pool; borrowers draw from it against collateral.

Decentralized lending usually does not underwrite a person’s credit file. It underwrites collateral. If the collateral’s oracle price falls through a threshold, the position can be liquidated by anyone the protocol allows. That is mechanical. It is not “the bank called you.”

Over-collateralization is typical: borrow less value than you lock. The margin exists because crypto prices move and because liquidation is not instant.

Flash loans, documented by platforms such as Aave and discussed on ethereum.org, let a borrower take funds and repay them in the same transaction. If repayment fails, the whole transaction reverts. There is no credit check because there is no period of unsecured exposure. (Aave’s broader flashLoan path can instead open a permitted collateral-backed debt position.) Flash loans are a composition trick. They can also be an ingredient in governance and oracle attacks when a protocol treats a fleeting token balance as lasting voting power or price.

Lending is not free of custody in the ordinary sense. Assets sit in the protocol’s accounts. Users rely on the program, its oracles, its collateral list and its operators. That is a different trust model from a bank deposit — not the absence of trust.

Exchanges and liquidity pools

A decentralized exchange (DEX) lets people swap assets without depositing to a centralized exchange’s hot wallet. Architectures differ: automated market makers (AMMs), on-chain order books, hybrid designs. Many familiar pool-based AMMs use liquidity pools — reserves of two or more assets — and a pricing function; the broader AMM label is not a guarantee that every design uses a conventional LP-funded pool. Uniswap v2’s constant-product rule, (x \cdot y = k), is the best-known pool-based example, not the only one.

Liquidity providers deposit assets and take a share of swap fees. They also take inventory risk, often nicknamed impermanent loss: if prices move, the pool’s mix can be worth less than simply holding the tokens. The Enterprise Ethereum Alliance’s DeFi risk guidelines treat this as a defined opportunity cost (and mention divergence loss / LVR as related measurements).

DEX mechanics are covered in the companion article Decentralized exchanges.

Stablecoins

Many DeFi positions are denominated in tokens that aim to stay near a reference, usually a dollar. Those tokens are stablecoins. They are not a single standard. Fiat-backed coins depend on an issuer and reserves. Crypto-collateralized coins depend on on-chain vaults and liquidation. Algorithmic designs depend on a mechanism that can fail, as TerraUSD did in May 2022.

DeFi uses stablecoins as a unit of account, as collateral, and as the asset people actually want to borrow. A lending market that looks “on-chain” can still be one issuer-freeze or one depeg away from disorder. See Stablecoins.

Derivatives and structured products

Perpetual futures, options vaults, synthetic assets and structured yield products exist as protocols on several chains. They add leverage, funding payments and more oracle dependence. This article does not catalogue them. The relevant point for a beginner is that a token named after a dollar, a stock or a yield is still a token: its payoff is whatever the program and its dependencies produce.

Collateral, oracles and liquidation

Collateral is an asset the protocol is willing to seize. An oracle tells the protocol what that asset is worth in the protocol’s unit of account. ethereum.org’s contract documentation notes that contracts cannot fetch off-chain facts themselves. So liquidation robots, interest rates and solvency checks all consume whatever the oracle wrote.

Oracle risk is first-class. The EEA guidelines list latency, inaccurate or manipulated sources, single points of failure, and weak oracle governance. A correct program plus a bad price is a correct disaster.

Liquidation is also a market. If liquidators cannot or will not buy the collateral — because of a crash, a congested chain, or a broken incentive — the protocol can be left with bad debt. That is credit risk in a pool that advertised itself as over-collateralized.

Composability and “money legos”

Because programs on the same chain can call each other atomically, a vault can deposit into a market, a market can read a pool price, and a flash loan can wrap the whole path. ethereum.org compares this to products that “speak the same language.”

Composition multiplies surface area. A bug in a token’s transfer hook, a quirk in a pricing function, or an unexpected reentrancy can become a bug in every protocol that integrated it. Auditing one contract is not auditing the graph it lives in.

Governance

Many protocols issue a token that votes on parameters, listings, or upgrades. Some execute successful votes on-chain. Some use an off-chain vote as a signal and have a multisig or other authorized account enact the result. Some are a multisig with a forum attached.

Token voting is not one-person-one-vote. It is usually one-token-one-vote, which concentrates power where tokens concentrate. A protocol that measures voting power only at an exploitable instant may even let temporary, borrowed balances influence a vote. Emergency powers, pause keys and “guardian” roles are common. They are centralization by design, often justified as incident response.

See DAOs for the broader governance picture.

Custody tradeoffs

“Non-custodial” in DeFi usually means: the protocol does not take your private key, and you can exit by sending a transaction if the chain and the program still allow it. It does not mean:

  • nobody can freeze a token (issuers can);
  • nobody can pause the market (admins can);
  • the website cannot be replaced with a phishing copy;
  • a bug cannot empty the pool;
  • a rollup sequencer or a bridge cannot stall your exit.

Self-custody of the keys plus protocol custody of the position is the normal combination. Both can fail. The EEA document treats key mismanagement and third-party custodians as separate, real risks.

A risk list that is not a scare poster

The EEA DeFi Risk Assessment Guidelines (July 2024) organize what practitioners actually worry about. Condensed for this article:

| Risk | What it means in practice | | --- | --- | | Smart-contract / software | A bug, a compiler issue, or an unexpected call sequence moves or freezes value. Deployed code is public and often hard to patch. | | Front end | The website or wallet UI is spoofed, injected, or merely confusing. The contract can be honest while the button is not. | | Oracle | The price or data feed is late, thin, or attacked. Liquidations fire on a fiction. | | Bridge | Value locked to represent an asset on another chain is stolen or stuck. Bridges can concentrate substantial value and attract attacks. | | MEV / ordering | Searchers and block producers reorder, insert or sandwich transactions. The user gets a worse price than the screen suggested. | | Governance / admin | A token vote, a multisig or a single key changes rules, pauses markets, or drains a treasury. | | Liquidity | You cannot exit at a reasonable price. Pools are shallow; liquidations fail; stablecoins depeg. | | Market | Prices move. Collateral crashes. “Impermanent” loss becomes realized. | | Counterparty | An issuer, custodian, or operator does not perform. Fiat-backed stablecoins sit here even when used inside “DeFi.” | | Compliance / legal | Using or operating the protocol may violate local rules; tax treatment is often unclear. |

None of these is unique to Ethereum. A Solana program can have an admin key. A Bitcoin-adjacent lending desk can be fully custodial. TVL (“total value locked”) is a marketing metric the EEA itself warns is not always “locked.”

What this article is not saying

DeFi is not automatically trustless. It is not automatically open to everyone (front ends geoblock; tokens freeze; protocols list collateral). It is not only Ethereum. It is not an investment strategy. Yield numbers are not savings-account rates; they are market variables, sometimes subsidies, sometimes risk premia for taking the table above.

Sources & further reading

  1. Decentralized finance (DeFi) Ethereum.org Primary · Documentation

    Use-case survey (lending, flash loans, swaps, stablecoins); layered stack; Ethereum-centric framing that this article deliberately qualifies.

  2. Introduction to smart contracts Ethereum.org Primary · Documentation

    Contracts as programs that hold funds and run when called; oracle limitation.

  3. Flash Loans Aave Primary · Documentation

    Primary protocol documentation for same-transaction borrowing, reversion on failed settlement and Aave v3’s optional collateral-backed debt path.

  4. How Uniswap Works Uniswap Primary · Documentation

    AMM vs order book; constant-product pools; permissionless market creation as one DEX architecture.

  5. Uniswap v2 Core Hayden Adams, Noah Zinsmeister, Dan Robinson Primary · Paper

    Primary AMM mechanics; \(x \cdot y = k\); 30 bp LP fee in v2; flash swaps; oracle manipulation warning.

  6. EEA DeFi Risk Assessment Guidelines Enterprise Ethereum Alliance Primary · Documentation

    Independent industry taxonomy: smart-contract, oracle, bridge, MEV, governance, custody, credit, market and legal risk; notes that TVL is not always locked.

  7. The Technology of Decentralized Finance (DeFi) Raphael Auer, Bernhard Haslhofer, Stefan Kitzler, Pietro Saggese and Friedhelm Victor Secondary · Paper

    Independent stack model and cross-check for lending, DEXs, collateral, stablecoins, governance, oracles, interfaces, composability and Terra’s failure.

  8. Assets on Solana Solana documentation Primary · Documentation

    Why a DeFi token on Solana is not, by default, an ERC-20 contract.

  9. Stablecoins Ethereum.org Primary · Documentation

    Fiat-backed vs crypto-backed vs algorithmic categories used in DeFi.