HomeGuides › What DeFi Is: How It Works Under the Hood and the Risks You Take On

Investing

What DeFi Is: How It Works Under the Hood and the Risks You Take On

How AMMs, over-collateralised lending and liquid staking actually work, with worked numbers for impermanent loss and liquidation, August 2026 TVL data and the risks that stack up.

IC By InfoCrypto Editorial Published 11 February 2026 Updated 28 August 2026 13 min read

Key points

  • Total DeFi TVL sits at roughly 99.2 billion dollars as of August 2026, and Ethereum alone accounts for about 49.8 billion of it — close to half.
  • Impermanent loss is not an abstraction: if one of the two assets in a pool doubles in price, a liquidity provider ends up 5.72 % worse off than if they had done nothing at all.
  • Real yield comes from trading fees and interest paid by borrowers. Anything far above that is token emissions, which dilute as soon as recipients sell.
  • The risks stack: contract, oracle, governance, liquidity and bridge. A flawless protocol can still lose everything through the bridge it depends on.
  • MiCA regulates service providers, not code. A genuinely decentralised protocol falls outside the regulation, which also means there is nobody to complain to.
Market data: Market data on this page was collected on 28 August 2026 and changes constantly. Check the linked sources before relying on it.

When somebody tells you a DeFi protocol pays 40 % a year, what they leave out is where that 40 % comes from. That is the only question worth asking. In traditional finance the source of yield is boring and well understood: somebody pays interest on a loan, somebody pays a fee on a trade. DeFi works the same way, except that a third source exists — the issuance of a brand-new token — which dresses itself up as yield and is really a dilution.

DeFi is a set of smart contracts that reproduce specific financial functions — swapping, lending, taking leverage, minting a stable asset — without a company holding the money or approving the transaction. It works, it moves tens of billions of dollars, and it has a record of catastrophic failures worth looking at squarely. What follows is the machinery: how a decentralised exchange sets a price, why your loan gets liquidated, where the yield genuinely comes from, and which layers of risk you are stacking without noticing.

What "decentralised" means in practice

Almost no protocol is fully decentralised, and the degree varies so widely that the word stops being useful unless you break it into four independent axes:

  • The contract: immutable or upgradeable? Most of the large ones are upgradeable behind a proxy. That means somebody — a DAO, a multisig — can change the logic of the code holding your money.
  • The parameters: interest rates, collateral ratios, which assets are accepted. Governance sets these, not the market.
  • The oracle: the price the contract uses to decide whether to liquidate you comes from off-chain. Whoever controls the oracle controls the liquidations.
  • The interface: the website you log in through usually lives on an ordinary server, on a domain that can be hijacked.

A protocol with an immutable contract, a decentralised oracle and fixed parameters is genuinely censorship-resistant. One with an upgradeable proxy and a five-person multisig is a company with extra steps. Both market themselves as DeFi.

The four basic building blocks

AMM-based DEXs: setting a price without an order book

A decentralised exchange like Uniswap does not match buy and sell orders. It uses an automated market maker: a pool holding two assets and a formula that derives the price from the quantities sitting inside it. The most widespread is the constant product rule:

x · y = k

Where x is the amount of the first asset, y the amount of the second and k a constant the swap cannot alter. If the pool holds 100 ETH and 250,000 USDC, k equals 25,000,000 and the implied price is 2,500 USDC per ETH. When somebody buys ETH they take ETH out and put USDC in: x falls, y rises, and because k has to hold, the next ETH costs more. That curve is why large trades suffer slippage — you are not buying at the market price, you are buying your way along the curve.

Liquidity providers deposit both assets and earn a fee on every swap, typically between 0.01 % and 1 % depending on the pool. In exchange they take on impermanent loss, the worst-explained concept in the sector and the one that costs beginners the most money.

Over-collateralised lending

On Aave or Morpho there is no credit assessment. You deposit an asset as collateral and you can borrow less than you deposited. Every asset has a maximum LTV (how much you may borrow) and a liquidation threshold (the point at which you get liquidated), and your position boils down to a single number, the health factor:

Health factor = (collateral value × liquidation threshold) ÷ debt value

Above 1 you are safe. The instant it drops below 1, anybody can trigger your liquidation and collect a bonus for doing so. No warning, no phone call, no grace period.

Decentralised stablecoins

The decentralised variant is minted against crypto collateral locked in a contract: you deposit more value than you issue and the system liquidates you if the collateral falls. That is the model behind DAI and its successor USDS, with market caps of 4.80 and 6.71 billion dollars as of August 2026, a long way behind USDT's 183.32 billion. It resists censorship well and congestion badly: on 12 March 2020 the Ethereum network jammed, liquidation bids never arrived, and 8.32 million dollars of collateral was liquidated for 0 DAI. I go into it in the guide on what stablecoins are.

Liquid staking

You deposit ETH, receive a token representing your share, and that token stays transferable while the original ETH is locked up validating. It is the largest category in DeFi: Lido holds 24.20 billion dollars of TVL as of August 2026. It adds a layer of risk on top of plain staking, because the derivative token can trade below its theoretical value when a lot of people want out at once.

The numbers as of August 2026

Category Reference protocol TVL (28 Aug 2026)
Liquid staking Lido $24.20B
Lending Aave V3 $17.46B
Staking pool SSV Network $12.57B
Lending Morpho Blue $9.62B
Liquid staking (CEX) Binance staked ETH $9.34B
Bridge / wrapped asset WBTC $9.07B
Bridge Coinbase Bridge $7.80B

Total DeFi TVL stands at roughly 99.2 billion dollars as of 28 August 2026 according to DefiLlama, and the split by chain remains overwhelmingly tilted towards Ethereum: 49.8 billion, close to half the total, against 5.9 billion on Solana, 5.5 on BSC, 5.5 on Base, 5.2 on Tron and 4.2 on Bitcoin. Layer 2 networks have absorbed plenty of activity, but the deep liquidity is still sitting on the base layer.

Note one detail in that ranking: four of the top seven entries are staking or bridges. The picture of DeFi as a swarm of sophisticated strategies does not survive contact with the data.

Worked example 1: impermanent loss with real numbers

You supply liquidity to an ETH/USDC pool with 1 ETH and 2,500 USDC, with ETH at $2,500 (close to the real August 2026 price of $2,505). Deposited value: $5,000. The constant is k = 1 × 2,500 = 2,500.

ETH rises to $5,000. Arbitrageurs buy ETH out of the pool until the internal price matches the external one. The new pool state works out as:

  • ETH in the pool = √(k ÷ price) = √(2,500 ÷ 5,000) = 0.7071 ETH
  • USDC in the pool = √(k × price) = √(2,500 × 5,000) = 3,535.53 USDC

Your position is now worth 0.7071 × 5,000 + 3,535.53 = $7,071.07.

Had you done nothing, you would hold 1 ETH ($5,000) plus 2,500 USDC = $7,500.

Difference: $428.93, or 5.72 % less. That is impermanent loss. Nobody stole anything: the pool sold your ETH off as the price climbed, so you end up holding less of the asset that appreciated and more of the one that did not. Had ETH gone up fourfold, the gap would be 20 %.

Do the fees make up for it? Suppose a 10-million-dollar pool doing 1 million dollars of daily volume at a 0.30 % fee. That is $3,000 a day; your 0.05 % share earns $1.50 a day, roughly $547 a year, or 10.95 % annualised. You would need 286 days of that volume to offset the $428.93. It is a simplified calculation — fees are reinvested and push k upward — but the order of magnitude holds: impermanent loss is instant, fees are slow.

The APY you see is not the APY you earn. Most interfaces annualise recent fee income and add token incentives valued at today's price. Neither figure subtracts impermanent loss, which depends on a price move that has not happened yet.

Worked example 2: how a loan gets liquidated

You deposit 4 ETH at $2,500 = $10,000 of collateral in a lending protocol. Assume a liquidation threshold of 82.5 % and a liquidation bonus of 5 % — the exact parameters are set by each protocol's governance and do change, so check them before you borrow. You take out 5,000 USDC.

  • Starting health factor = (10,000 × 0.825) ÷ 5,000 = 1.65

ETH falls to $1,500. Your collateral is now worth $6,000:

  • Health factor = (6,000 × 0.825) ÷ 5,000 = 0.99 → liquidatable

The precise liquidation point is the price at which the factor equals 1: you need 5,000 ÷ 0.825 = $6,060.61 of collateral, meaning ETH at $1,515.15. A 39.4 % drop from where you started.

The liquidator repays up to 50 % of your debt (2,500 USDC) and takes collateral worth that amount plus the 5 % bonus: $2,625, which at $1,515.15 per ETH is 1.7325 ETH. You are left with 2.2675 ETH ($3,435.60) and $2,500 of debt, at a health factor of 1.13. The liquidation itself cost you $125 in bonus; the rest of the loss is the market.

Add the gas cost of trying to top up collateral mid-panic: at 0.151 gwei, the level seen in August 2026, that is pennies; during a congestion episode, it is not. I break it down in the gas fees guide.

Where the yield actually comes from

There are only three sources, and it pays to know which one is funding you:

  1. Trading fees. Paid by people making swaps. Sustainable, but capped by real volume.
  2. Borrower interest. Somebody is paying for leverage. Sustainable as long as credit demand holds.
  3. Token emissions. The protocol prints its governance token and hands it to you. That is not yield: it is a transfer from the token's future holders to you, marked at today's price.

A triple-digit APY is arithmetically incompatible with the first two sources. When you see one, the question is not how much you will make but who is paying for it and how long they can keep doing so. The answer is almost always: it is paid in emissions, and emissions get sold.

The risks stack

  • Contract risk. A bug in the code. An audit lowers the probability, it does not remove it; nearly every hacked protocol had been audited.
  • Oracle risk. If the price the contract consumes can be manipulated, liquidations or under-collateralised loans can be forced.
  • Governance risk. Whoever controls the votes controls the parameters, and the parameters control your money.
  • Liquidity risk. A pool with a high TVL can still have laughable depth at the size you want to exit.
  • Bridge risk. If your asset reached that chain via a bridge, you depend on the bridge's security, not the chain's.

The record is explicit: the biggest holes are not in the protocols, they are in the bridges. Ronin Network lost around 620 million dollars on 23 March 2022 to compromised validator keys; Poly Network around 612 million on 10 August 2021 (the attacker returned 578.6 million two days later); BSC Token Hub around 570 million on 6 October 2022; Wormhole more than 320 million on 2 February 2022 through a signature verification flaw. In pure DeFi, KelpDAO lost around 292 million on 18 April 2026, Drift Protocol around 285 million on 1 April 2026 and Cetus Protocol around 223 million on 22 May 2025. Chainalysis puts total funds stolen during 2025 at more than 3.4 billion dollars, with the three largest incidents accounting for 69 % of losses at services.

Flash loans: uncollateralised borrowing and attacks

A flash loan is a loan taken out and repaid inside a single transaction. If it has not been repaid with its fee by the end of that transaction, the whole transaction reverts and it is as though nothing ever happened. That is why no collateral is needed: default risk is mathematically zero.

The legitimate use is arbitrage and refinancing positions. The offensive use is what makes headlines: with a flash loan you briefly control enormous capital, use it to move the price of a shallow pool that another protocol relies on as its oracle, extract value from that second protocol at the distorted price and repay the loan, all in one block. The governance variant destroyed Beanstalk on 17 April 2022: the attacker borrowed enough voting tokens to approve and execute his own proposal in the same instant and walked away with 182 million dollars. The loan was not the flaw; the flaw was allowing a vote and its execution with no delay in between.

The MiCA gap

MiCA regulates crypto-asset service providers: identifiable entities, with a registered office, that custody, exchange or advise. A centralised exchange fits. A smart contract nobody controls does not. The regulation itself acknowledges in its recitals that services provided in a fully decentralised way, without any intermediary, fall outside its scope, and it tasks the European Commission with a dedicated report on decentralised finance.

The consequence cuts both ways. There is no licence to obtain in order to deploy a protocol, but as a user you get none of MiCA's protections: no segregated custody, no mandatory pre-contractual disclosure, no provider liability regime, no supervisor to turn to. If the contract does what its code says and that code ruins you, no legal breach has occurred.

The grey zone is vast: almost every protocol has an interface run by a company, an identifiable team and a foundation with a treasury. Where free software ends and the provision of a service begins is exactly the line European supervisors have been trying to draw. For the full framework, see the guide on crypto regulation.

What to check before you deposit

  • Work out what share of the advertised APY comes from fees and what share from token emissions. If you cannot find out, assume it is almost all emissions.
  • Check whether the contract is upgradeable and who holds that key. A proxy controlled by a three-person multisig is a custody risk, not an autonomous protocol.
  • Find out where the oracle sources its price and how deep the market feeding it actually is.
  • If the asset reached that chain via a bridge, count the bridge as a separate risk of the same magnitude as the protocol.
  • Calculate your impermanent loss for a 50 % and a 100 % price move before you provide liquidity, not afterwards.
  • If you borrow, decide in advance at which health factor you will add collateral, and leave margin: in a fast drop you will not make it in time.
  • Periodically revoke the spending approvals you have granted to contracts you no longer use.

DeFi is neither a better nor a worse version of conventional finance: it is a system with a different risk profile, where the counterparty is a program rather than a company, and where the absence of an intermediary also means the absence of recourse. If you go in, go in knowing which mechanism you are using and what happens to your money when that mechanism breaks.

Frequently asked questions

Is DeFi safer than a centralised exchange?

The risks are different, not smaller. On an exchange the risk is that the company fails or freezes your funds. In DeFi the risk is that the contract has a bug, the oracle reports a wrong price, or the bridge your money crossed turns out to be vulnerable. The practical difference is that in DeFi there is nobody to complain to: if the contract executes exactly what its code says, no legal breach has occurred.

What is impermanent loss and why is it called that?

It is the gap between what your funds are worth inside a liquidity pool and what they would be worth if you had simply held them. It appears whenever the relative price of the two assets changes. It is called impermanent because it disappears if the price returns to where it started — but the moment you withdraw your liquidity, it becomes permanent.

Why do DeFi loans demand more collateral than they lend?

Because there is no credit check and no way to chase you if you never repay. The protocol can only protect itself by demanding collateral worth more than the debt and liquidating it automatically when its value falls. On Aave V3 a 10,000-dollar ETH deposit lets you borrow considerably less, and if the ratio deteriorates a liquidator closes part of your position without any warning.

Can a 300 % APY be real?

It can be real and be a warning at the same time. That number almost never comes from fees: it comes from handing out a freshly minted governance token priced at today's quote. If everyone who receives it sells it, the real APY converges towards the part that is actually sustainable. Before you deposit, work out what share of the yield is fees and what share is emissions.

Sources and references

  1. DefiLlama — total TVL and protocol rankings
  2. DefiLlama — TVL by chain
  3. Uniswap Docs — Concepts: the protocol and the constant product formula
  4. Aave — protocol documentation (health factor, liquidations)
  5. Chainalysis — Crypto hacking and stolen funds 2026
  6. CoinDesk — Attacker Drains $182M From Beanstalk Stablecoin Protocol
  7. Regulation (EU) 2023/1114 (MiCA) — consolidated text on EUR-Lex
  8. CNMV — Crypto-asset regulation (MiCA)
Important notice. InfoCrypto is an educational site. Nothing here is financial, tax or investment advice. Crypto assets are high risk: you can lose all the capital you invest. Always verify data against the original sources before making any decision, and consult a licensed professional if you need to.

Related guides