Independent DeFi protocol research

Protocol Anatomy

How DeFi protocols work, where the money sits, how they change.

An independent educational resource for understanding how DeFi protocols work: how they account for assets, price trades, liquidate collateral, and change across versions.

Questions this site answers

All questions

What a guide is for

The mechanism

What state the contracts store, which inputs change it, and which invariant the transaction is required to leave behind.

The money

Where collateral, reserves, fees, and shares sit after a supply, swap, mint, or withdrawal, including the residual loss when a rule fails.

The version

Which design is deployed, which design it replaced, and which behavior belongs to an older contract that integrations still call.

Eighteen protocols

Pooled and isolated lending, two kinds of automated market maker, a collateralized and a synthetic dollar, liquid staking and restaking, a capital allocator, a yield market, a vault-based exchange, an on-chain perpetuals exchange, a vote-escrow exchange, a modular lending kit, the oracle layer many of them read and the multisig that guards their keys. They are not eighteen copies of one architecture.

  1. 01 Aave Lending

    Pooled overcollateralized borrowing, with utilization-based interest and collateral liquidation.

  2. 02 Uniswap Automated market maker

    Constant-product swaps against pooled reserves, with concentrated liquidity in v3 and v4.

  3. 03 MakerDAO / Sky Collateralized stablecoin

    Overcollateralized stablecoin debt against vaults, with a governance-set stability fee and a savings rate.

  4. 04 Curve Finance Automated market maker

    StableSwap and CryptoSwap invariants, with LP tokens minted against pool liquidity rather than a constant-product share.

  5. 05 Lido Liquid staking

    Share-based claims on pooled staked ether, with oracle accounting and a withdrawal queue.

  6. 06 Morpho Lending

    A singleton contract of isolated, immutable lending markets, with curated vaults on top and a separate fixed-rate market protocol.

  7. 07 EigenLayer Restaking

    Delegated, slashable stake allocated to operator sets that external services define, with delayed allocation and withdrawal.

  8. 08 Ethena Synthetic dollar

    Hedged backing assets, signed-order minting for approved counterparties, and a staking vault paid from backing revenue.

  9. 09 Spark Capital allocator and lending

    An Aave V3 fork funded by Sky, savings vaults backed by rate-limited allocations, and governance through the Sky Atlas.

  10. 10 Pendle Yield trading

    Yield tokenization into PT and YT, traded against SY in a pool whose curve tightens toward maturity.

  11. 11 Compound Lending

    Pooled borrowing against inert collateral, with one base asset per market, signed balances and a reserve-funded absorb liquidation.

  12. 12 Balancer Exchange

    A single Vault that holds all pool tokens and settles debts and credits atomically, with pluggable pool math and hooks.

  13. 13 Chainlink Oracle

    A decentralized oracle network signs aggregated reports, and an onchain aggregator verifies a quorum and exposes the median behind a proxy.

  14. 14 Hyperliquid Derivatives

    A layer-1 chain with an onchain order book and margin engine, a validator-published oracle, and a community vault as liquidation backstop.

  15. 15 Rocket Pool Liquid staking

    Pooled ETH is matched with node-operator bonds into 32 ETH validators, and rETH's exchange rate is updated from reported Beacon Chain balances.

  16. 16 Euler Lending

    Single-asset ERC-4626 vaults that accept each other's shares as collateral, coordinated by an account connector and settled by controller-vault health checks.

  17. 17 Aerodrome and Velodrome Exchange

    A decentralized exchange whose token emissions are directed by locked or staked holders, who in return earn revenue from the pools they favor.

  18. 18 Safe Infrastructure

    A proxy smart account whose logic verifies an owner threshold of signatures over a typed transaction hash, with optional modules, guards and a fallback handler.

Version and architecture

Each comparison is limited to versions that the cited documentation or repositories actually describe.

Compare protocols

The same question asked of different designs.

All comparisons

Concepts

Markets

Automated market makers

What an AMM prices, which state it stores, and how Uniswap and Curve implement different invariants.

Markets

Constant-product pricing

How the x · y = k invariant sets a Uniswap v2 price, and where v3 and Curve stop using it uniformly.

Markets

Concentrated liquidity

How a Uniswap v3 or v4 position holds token0, token1, or both as price moves through its tick range.

Credit

Lending pools and utilization

How a shared lending pool measures utilization and why that ratio, not an order book, sets borrower competition.

Credit

Interest-rate models

How Aave’s two-slope utilization curve differs from Maker’s governance-set stability fee.

All concepts · Glossary