WhitmanTrading

What Is DeFi? Code-Run Markets and Where the Money Sits

DeFi, short for decentralized finance, is lending, borrowing and trading run by programs on a public blockchain instead of by a bank or broker. The program holds the deposits and sets prices with a fixed formula, so anyone with a wallet can use it without an account at a bank or broker.

A bank, a broker and an exchange all do one job in common: they hold other people’s money and decide who gets what. Decentralized finance hands that job to software whose rules anyone can read. This page covers how that software sets a price, what can go wrong, and how much money has actually been parked in it, from a public data source rather than from anyone’s sales pitch.

How it works

The core piece is a smart contract, a program stored on a blockchain such as Ethereum. Once it is deployed, it runs exactly as written each time someone calls it. Users send tokens to it, and it sends tokens back according to its rules.

No account is opened. A user connects a wallet, signs a transaction and pays the network a fee. There is no application form, no identity check by the program itself, and no opening hours. The same rules apply at 3am on a Sunday as at noon on a Tuesday.

Prices come from the contract’s own formula or from a price feed, not from a dealer quoting a spread. That is the part a trader needs to understand, because the formula decides what a trade really costs.

Each action is public. Every deposit, swap and loan is written to the chain where anyone can see it. That openness is the reason the totals further down this page can be measured at all.

The pieces DeFi is built from

Exchanges without an order book. Instead of matching a buyer with a seller, a decentralized exchange keeps a pool holding two tokens. Traders swap against the pool, and people who deposit into it earn a share of the trading fees.

Lending without a loan officer. A borrower deposits one token as collateral and borrows another, usually worth less than the collateral. If the collateral’s value falls too far, the program sells it to repay the loan. Nobody phones first.

Dollar tokens as the unit of account. Much of the trading and lending in DeFi is priced against stablecoins, tokens built to stay at $1, which serve as the cash side of many pools and loans.

Price feeds, called oracles. A lending program needs to know what the collateral is worth. It reads that from an outside feed, which makes the feed one of the most important, and most attacked, parts of the whole arrangement.

A worked example

Uniswap’s documentation, read on 25 Sep 2026, describes pool pricing as a constant product formula: x times y equals k, where x and y are the two token balances and k must not fall after a trade. Here is that rule on a hypothetical pool, with round numbers chosen for the arithmetic.

The pool holds 100 ETH and 250,000 USDC, so k is 100 times 250,000, or 25,000,000. The pool’s price is 250,000 divided by 100, which is $2,500 per ETH.

A trader pays in 25,000 USDC. Take a hypothetical 0.3% fee off first, which leaves 24,925 USDC counting toward the swap. The formula is applied as if the pool held 274,925 USDC; the 75 USDC fee also goes into the pool, where, the documentation says, swap fees accrue to the depositors.

The formula now fixes the ETH side. It must be 25,000,000 divided by 274,925, which is 90.9339 ETH. The pool started with 100, so the trader receives 9.0661 ETH.

The trader’s average price is 25,000 divided by 9.0661, or $2,757.52. That is 10.3% above the $2,500 the pool showed before the trade. Nobody charged a commission of 10.3%; the trade was simply large next to the pool.

The same pool, a $1,000 trade. After the same fee, it returns 0.3972 ETH, an average of $2,517.52, only 0.7% above the starting price. The lesson is the one that applies to slippage on any market: cost rises with trade size relative to what is available.

Where the money sits

DeFi is spread across hundreds of blockchains, but not evenly. DeFiLlama’s chain list, downloaded on 25 Sep 2026, shows 331 chains with money in them, yet only 10 hold $1 billion or more.

One network dominates. Ethereum alone holds $53.64 billion, 56.1% of the total across chains. Solana follows at 6.9%, then Base at 6.5%, BSC at 6.1% and Tron at 5.9%, so the five largest together hold 81.6%. Bitcoin’s own chain adds 4.7%, and the other 325 chains hold 13.7% between them.

That concentration matters to a user. Fees, speed and the choice of apps differ by chain, and moving tokens between chains usually means a bridge, another program with its own risks.

The original data

The series: DeFiLlama’s headline total value locked, the dollar value of tokens deposited in the programs it tracks, summed across chains, one reading a day from February 2018 to 25 Sep 2026. It was downloaded from DeFiLlama’s public interface on 25 Sep 2026, and the readings used here are published as a CSV of DeFi totals.

The boom and the bust. The total was $0.6 billion at the end of 2019 and $15.1 billion at the end of 2020. It reached $177.5 billion on 9 Nov 2021, the highest reading in the series.

Then it fell 79.7%, to $36.0 billion on 13 Oct 2023. The year-end readings trace the slide: $163.3 billion at the end of 2021, $38.3 billion at the end of 2022 and $52.8 billion at the end of 2023.

Bars of DeFi's total value locked at each year end from 2019, the $177.5 billion peak of November 2021, the 2023 low and the September 2026 reading.
DeFi total value locked at year ends, the 2021 peak, the 2023 low and 25 Sep 2026, in billions of dollars. Source: DeFiLlama, historical total value locked (defi-tvl-2026-09-25.csv).

The recovery was large but has not held. The total was $115.9 billion at the end of 2024 and $113.3 billion at the end of 2025, after touching $171.1 billion on 7 Oct 2025, which is 4.75 times the 2023 low.

On 25 Sep 2026 it stood at $95.3 billion: 46.3% below the 2021 peak and 44.3% below the October 2025 high, but still 2.64 times the 2023 low.

Read the swings with care. The total is a dollar value, so it falls when token prices fall even if no one withdraws a thing. A drop of this size mixes lower prices with money leaving, and the series alone cannot separate them.

The chain split for the same day is published as a CSV of DeFi by chain. It shows how little of the money sits outside the largest few networks.

Horizontal bars of each blockchain's share of DeFi deposits on 25 September 2026, led by Ethereum at 56.1 percent.
Share of DeFi total value locked by chain on 25 Sep 2026, the six largest and the other 325 combined. Source: DeFiLlama, total value locked by chain (defi-chains-2026-09-25.csv).

Video coverage is thin and mostly about income. Of the 24,971 trading and investing videos in the corpus this site studies, 6 have DeFi or decentralized finance in the title, from 6 channels, at a median of 2,786.5 views. The most watched, at 918,723 views, is a beginner’s guide to earning from it. Each video is counted once.

When it fails

The code is wrong. A smart contract does what it says, including its mistakes. A flaw in the logic can let an attacker withdraw deposits in a way the authors never intended, and the chain records it as a valid transaction.

The price feed is wrong. A lending program that reads a bad price can sell sound collateral or lend against worthless collateral. If a feed reads a thin market, pushing that market for a few seconds can fool it, and the program acts on the reading at once.

The pool is too small. The worked example shows a 10.3% price penalty on a single trade, charged by arithmetic rather than by anyone’s choice. A trader who does not check the quoted rate before signing pays it.

Liquidation at the worst moment. A borrower’s collateral is sold automatically when it falls below the program’s limit, often during the sharpest drop of the day. Nobody waits for the price to recover, and nobody sends a margin call first.

The “decentralized” part can be thinner than it sounds. An app may keep an admin key that can change the code or freeze the program, and users may reach the app only through one company’s website. Either can fail or be switched off.

And nobody stands behind the deposit. A bank answers to a regulator. A program answers to its own code, and nothing in the code promises to repay a loss.

What DeFi does not change

It does not remove risk; it moves it. The risk of a bank failing is replaced by the risk of code failing, a feed failing or a key being stolen.

It does not make a trade cheaper by default. Network fees, pool fees and slippage can together cost more than a broker would charge on the same size.

And it does not change the tax. The IRS’s virtual currency FAQ, question 16, read on 25 Sep 2026, says exchanging one virtual currency for another gives a capital gain or loss, and a swap in a DeFi app is such an exchange. The crypto tax page covers how a swap is taxed.

The Ethereum page explains the network that runs most of these programs and why every action on it costs a fee. The crypto page covers the wider market DeFi sits in, including the hours and structure that differ from stocks. And the slippage page explains the cost the worked example above measures, as it applies on any market.

What I actually do

Before depositing into any DeFi app, find out three things: who can change its code, what it does when a price feed goes wrong, and how you would get the money out if its website went offline. If any answer is unclear, keep the amount to what you would accept losing outright.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.