Appendix H: DeFi Protocol Architecture Comparison

This appendix provides side-by-side comparisons of the dominant protocols in four DeFi categories: decentralized exchanges, lending protocols, stablecoins, and Layer 2 scaling solutions. Data is current as of Q1 2025; TVL figures and market caps fluctuate significantly. Use this as a structural reference, not a snapshot of current prices.

For the underlying mechanics of each category, refer to Part V (Chapters 21-25). This appendix focuses on comparative architecture, not first-principles explanation.


H.1 Decentralized Exchanges (DEXs)

H.1.1 Comparison Matrix

Dimension Uniswap V2 Uniswap V3 Curve Finance Balancer V2
Launch date May 2020 May 2021 Jan 2020 Mar 2021
Chain(s) Ethereum + 8 L2s/alt-L1s Ethereum + 10 L2s/alt-L1s Ethereum + 15 chains Ethereum + 7 chains
Mechanism Constant product AMM (x * y = k) Concentrated liquidity AMM StableSwap invariant (hybrid constant-sum/product) Weighted pools (generalized AMM)
Fee tiers 0.30% flat 0.01%, 0.05%, 0.30%, 1.00% 0.01%-0.04% (stable pools), 0.04%-0.40% (crypto pools) 0.01%-10% (pool-creator defined)
Capital efficiency Low — liquidity spread across entire price range (0, infinity) High — LPs concentrate liquidity in specific price ranges; up to 4,000x more efficient than V2 for tight ranges Very high for like-kind assets (USDC/USDT); moderate for volatile pairs Moderate to high depending on pool weights
LP position type Fungible (ERC-20 LP tokens) Non-fungible (ERC-721 position NFTs) Fungible (LP tokens) Fungible (BPT tokens)
Impermanent loss Standard (see Ch. 22 formula) Amplified — concentrated ranges experience IL faster but earn more fees Minimal for pegged-asset pools; standard for crypto pools Varies with weight configuration; 80/20 pools reduce IL
MEV exposure High (sandwich attacks common) High (concentrated positions make sandwich more profitable) Moderate (low-slippage pools reduce sandwich profit) Moderate
Governance token UNI UNI CRV + veCRV (vote-escrowed) BAL + veBAL
Protocol revenue model No protocol fee (can be activated by governance: 1/6 of LP fees) Optional protocol fee (governance-controlled, up to 1/4 of LP fees) Admin fee (50% of trading fees to veCRV holders) Protocol fee (up to 50% of swap fees, governed by veBAL)
TVL (Q1 2025) ~$1.5B (declining — migrating to V3) | ~$4.5B ~$2.0B | ~$1.0B
Daily volume (est.) ~$200M | ~$2.0B ~$300M | ~$150M
Key innovation Proved permissionless AMMs can work at scale Concentrated liquidity — LPs act as mini order books Low-slippage swaps for correlated assets Programmable pools with arbitrary weights and logic
Codebase license GPL-3.0 (open source) BSL 1.1 (time-limited restriction, converted to GPL after 2 years) MIT GPL-3.0

H.1.2 When to Use Each

  • Uniswap V2: Legacy; useful for understanding AMM basics and for long-tail tokens where V3 liquidity is thin.
  • Uniswap V3: Default choice for most swaps. Best price execution for major pairs (ETH/USDC, WBTC/ETH). Requires active LP management.
  • Curve: Best for stablecoin-to-stablecoin swaps and correlated-asset swaps (stETH/ETH, WBTC/renBTC). The "Curve Wars" for CRV emissions make it central to DeFi governance dynamics.
  • Balancer: Best for portfolio-style liquidity provision (e.g., 80% ETH / 20% USDC pool mimics holding a portfolio). Custom pool types enable novel DeFi primitives (Boosted Pools, Managed Pools).

H.1.3 Major Incidents

Protocol Date Incident Impact
Uniswap V2 Apr 2020 imBTC pool drained via ERC-777 re-entrancy ~$300K lost; demonstrated risks of ERC-777 compatibility
Uniswap V3 Jul 2023 Vyper compiler bug exploited via Curve pools (not directly Uniswap) $70M+ total across affected Curve pools; Uniswap V3 core contracts unaffected
Curve Jul 2023 Vyper re-entrancy bug exploited in multiple pools (CRV/ETH, alETH, msETH, pETH) ~$70M drained; CRV price collapsed 30%; triggered DeFi-wide contagion via Aave CRV lending positions
Curve Aug 2022 DNS hijack of curve.fi frontend Users signing transactions on malicious frontend lost ~$575K; smart contracts were not compromised
Balancer Sep 2023 Vulnerability in boosted pools; proactive mitigation by team ~$2.1M lost despite early warning; ~$200M at risk was migrated safely

H.2 Lending Protocols

H.2.1 Comparison Matrix

Dimension Aave V3 Compound V3 (Comet) MakerDAO / Sky
Launch date Mar 2022 (V3); V1: Jan 2020 Aug 2022 (V3); V1: Sep 2018 Dec 2017 (Single-collateral DAI); Nov 2019 (Multi-collateral)
Architecture Pool-based: all assets in shared liquidity pools; multiple isolated markets Per-asset market: each Comet deployment has ONE base asset (e.g., USDC) and multiple collateral assets Vault-based: users open individual collateral vaults (CDPs) and mint DAI against them
Interest rate model Variable rate: utilization-based curve with kink (optimal rate jumps above target utilization); stable rate option (being phased out) Variable rate: utilization-based curve with kink; no stable rate option Stability fee: governance-set fixed rate per collateral type; not market-driven
Governance token AAVE (staking for safety module + governance) COMP (governance only) MKR (governance + recapitalization backstop)
Key innovation E-mode (high-efficiency mode for correlated assets), Portal (cross-chain liquidity), isolation mode for new assets Simplified single-asset model reduces attack surface; automatic account management; absorber mechanism for liquidations First decentralized stablecoin; Peg Stability Module (PSM) for arbitrage; Real-World Asset (RWA) vaults
Collateral types Broad: 100+ assets across deployments Narrow: 5-8 collateral assets per Comet market Curated: ~30 collateral types including RWAs, LP tokens, staked assets
Liquidation mechanism Dutch auction; liquidators repay debt and receive discounted collateral Absorbed positions are socialized across protocol reserves; protocol buys collateral at discount Collateral auctions: English auction for collateral, reverse Dutch auction for debt coverage
Oracle Chainlink price feeds (primary); custom feeds for some assets Chainlink price feeds Chainlink + Maker's own oracle network (medianizer); governance can override
Flash loans Yes (0.05% fee on V3) No Flash mint DAI (no fee, up to debt ceiling)
Risk management Per-asset risk parameters: LTV, liquidation threshold, liquidation bonus, supply/borrow caps, debt ceiling for isolated assets Per-market supply caps, borrow caps, and absorb limits; simpler risk model due to single-base-asset design Per-vault-type parameters: stability fee, liquidation ratio, debt ceiling, dust limit; aggressive governance management
Cross-chain Yes (Portal for cross-chain asset transfer; deployed on 8+ chains) Multi-chain deployment (Ethereum, Arbitrum, Polygon, Base, Optimism) but no native cross-chain Primarily Ethereum mainnet; DAI bridges to L2s via Teleport system
TVL (Q1 2025) ~$12B across all deployments | ~$3B across all markets ~$8B (DSR + vaults + RWA)
Revenue model Spread between borrow and supply rates; flash loan fees; liquidation penalties Spread between borrow and supply rates; reserve factor Stability fees (interest on DAI debt); liquidation penalties; RWA yields

H.2.2 Interest Rate Mechanics Comparison

All three use utilization-based models, but with different shapes:

Aave V3 (Variable Rate):

If utilization < optimal (e.g., 80%):
    borrowRate = baseRate + (utilization / optimal) * slope1
If utilization >= optimal:
    borrowRate = baseRate + slope1 + ((utilization - optimal) / (1 - optimal)) * slope2

Typical: baseRate = 0%, slope1 = 4%, slope2 = 300%, optimal = 80%
At 80% utilization: 4% APR. At 90%: ~34% APR. At 95%: ~154% APR.

Compound V3:

Similar kink model, but per-market (USDC market has different params than WETH market).
Utilization = total borrows / total supply of base asset.
Rate adjusts per-block via governance-set parameters.

MakerDAO:

Stability fee is fixed by governance vote, not market-driven.
DAI Savings Rate (DSR) is set by governance to control DAI demand.
No utilization curve — rates are managed politically.

H.2.3 Major Incidents

Protocol Date Incident Impact
Aave Nov 2022 Avi Eisenberg attempted CRV short squeeze on Aave V2; borrowed $40M CRV against USDC collateral | ~$1.6M bad debt absorbed by Aave; led to accelerated V3 migration and new risk parameter framework
Aave Mar 2023 Euler Finance hack ($197M) caused stETH depeg scare; Aave exposure monitored closely No direct loss to Aave; highlighted contagion risk in DeFi lending
Compound Sep 2021 Governance proposal bug distributed ~$80M in excess COMP rewards | $80M in COMP tokens erroneously distributed; some returned voluntarily; governance fix deployed
Compound Apr 2023 Governance attack: Golden Boys (Humpy) accumulated COMP to pass proposal redirecting $24M to their own Goldilocks strategy Proposal passed but was paused by emergency multisig; exposed governance centralization trade-offs
MakerDAO Mar 2020 "Black Thursday" — ETH crashed 43% in one day; liquidation auctions had zero bidders due to Ethereum congestion ~$8.3M in undercollateralized vaults; $5.4M minted to cover bad debt via MKR dilution auction
MakerDAO Oct 2022 Governance voted to allocate $500M to US Treasury bonds via Monetalis Clydesdale Successful; demonstrated RWA strategy but raised regulatory concerns about DAI's "decentralization"

H.3 Stablecoins

H.3.1 Comparison Matrix

Dimension USDT (Tether) USDC (Circle) DAI (MakerDAO) FRAX
Launch date Feb 2015 Sep 2018 Dec 2017 Dec 2020
Issuer Tether Limited (BVI) Circle Internet Financial (US) MakerDAO (decentralized protocol) Frax Finance (decentralized protocol)
Peg mechanism Fiat-collateralized: redeemable 1:1 for USD from issuer Fiat-collateralized: redeemable 1:1 for USD from issuer Over-collateralized: crypto collateral (150%+ ratio) locked in vaults; PSM for arbitrage Hybrid: partially algorithmic, partially collateralized; collateral ratio adjusted by protocol
Backing composition (Q1 2025) ~85% US Treasuries, ~10% reverse repos, ~5% other (cash, secured loans, corporate bonds) ~80% US Treasuries, ~20% cash / bank deposits ~50% RWA (Treasuries via special purpose vehicles), ~25% crypto (ETH, stETH, WBTC), ~15% stablecoins (USDC via PSM), ~10% other ~90% USDC and Treasuries (moved to near-fully collateralized as "FRAX V3")
Market cap (Q1 2025) ~$95B | ~$35B ~$5B | ~$1B
Regulatory status Unregulated (not registered in US); settled with NY AG ($18.5M, 2021) and CFTC ($41M, 2021) for misrepresenting reserves Regulated (US state money transmitter licenses; applied for bank charter); MiCA-compliant in EU Not regulated as stablecoin (no single issuer); some jurisdictions classify as decentralized protocol Not regulated; transitioning toward structured compliance
Transparency Quarterly attestations (not full audits) by BDO Italia since 2021; historically opaque Monthly attestations by Deloitte; daily reserve composition via API; audited financial statements Fully transparent: all vaults visible on-chain; RWA positions verifiable via MakerBurn dashboard On-chain collateral visible; RWA positions via FraxFerry
Peg stability record Brief depegs during market stress (May 2022: dropped to $0.95); consistently recovers | Major depeg: Mar 2023, dropped to $0.87 when SVB collapsed (Circle held $3.3B at SVB); recovered within 3 days after FDIC intervention | Stable during crypto downturns; brief depeg to $1.03 during March 2023 USDC crisis (USDC in PSM exposure) Multiple small depegs during early period; improved stability since V2 (2022) and V3 (2023)
Censorship/Freeze capability Yes: Tether can blacklist addresses (has frozen $1B+ in USDT on request from law enforcement) | Yes: Circle can blacklist addresses (froze $75M connected to Tornado Cash; complies with OFAC sanctions) Limited: MakerDAO governance cannot freeze individual DAI; but can emergency-shutdown the entire system No direct freeze capability on FRAX tokens
Chain availability 15+ chains (Ethereum, Tron, Solana, Avalanche, etc.) 10+ chains (Ethereum, Solana, Arbitrum, Base, Polygon, etc.) Ethereum primary; bridged to L2s via Maker Teleport Ethereum primary + Fraxtal L2; bridged to multiple chains
Yield mechanism None (Tether keeps all reserve yield) None from USDC itself; USDC via Coinbase earns ~4-5% APY via their reward program DAI Savings Rate (DSR): currently ~8% APY, funded by stability fees and RWA yield; deposited via sDAI sFRAX: ~5% APY from treasury yield; frxETH for ETH staking yield
Key risk Counterparty risk (trust in Tether's reserves); regulatory risk (unregistered) Counterparty risk (bank deposits); regulatory risk (government orders can freeze/seize); SVB proved banking risk Smart contract risk; governance risk (MKR holders control parameters); RWA counterparty risk Algorithmic component risk (reduced in V3); small market cap limits liquidity depth

H.3.2 How Pegs Work: Mechanism Comparison

USDT / USDC (Fiat-Collateralized):

Peg Maintenance:
1. Authorized participants (APs) can mint new USDT/USDC by depositing $1 per token
2. APs can redeem USDT/USDC for $1 from the issuer
3. If market price < $1: APs buy cheap on market, redeem for $1 (profit)
4. If market price > $1: APs mint new tokens at $1, sell on market (profit)
5. Arbitrage keeps price at $1 (as long as APs trust redemptions will be honored)

Single point of failure: issuer solvency and willingness to honor redemptions

DAI (Over-Collateralized):

Peg Maintenance:
1. Users lock collateral (e.g., $150 ETH) to mint DAI ($100)
2. If collateral value falls below liquidation ratio, vault is auctioned
3. Stability fee (interest) adjusts DAI supply cost
4. DAI Savings Rate adjusts DAI demand
5. PSM allows direct 1:1 swap between DAI and USDC (both directions)

Multiple mechanisms: overcollateralization, liquidation, rate policy, PSM arbitrage

FRAX (Hybrid):

Peg Maintenance (V3):
1. Near-fully collateralized by USDC + Treasuries
2. AMO (Algorithmic Market Operations) controllers automatically:
   - Add/remove liquidity from Curve and Uniswap pools
   - Lend to Aave/Compound to earn yield
   - Manage collateral allocation
3. frxETH/sfrxETH generates yield from ETH staking
4. Collateral ratio maintained above 100% (target: 100%+)

V3 largely abandoned the algorithmic component after Terra/Luna collapse

H.3.3 Major Incidents

Stablecoin Date Incident Impact
USDT Apr 2019 NY Attorney General investigation revealed Bitfinex (sister company) used Tether reserves to cover $850M loss | $18.5M settlement; USDT briefly dropped to $0.97; Tether began publishing reserve breakdowns
USDC Mar 2023 Silicon Valley Bank collapse; Circle had $3.3B of USDC reserves at SVB | USDC depegged to $0.87; $2B+ outflows from DeFi; DAI also depegged (PSM held USDC); peg restored after FDIC backstop
DAI Mar 2020 Black Thursday ETH crash; liquidation system failed under congestion $8.3M bad debt; emergency MKR auction to recapitalize; led to addition of USDC as collateral (controversial)
DAI Aug 2022 Tornado Cash sanctions; USDC in PSM could be frozen; existential debate about DAI's dependence on USDC Led to Maker's "Endgame" plan to reduce USDC exposure; accelerated RWA diversification
FRAX May 2022 Terra/Luna collapse caused scrutiny of all algorithmic stablecoins; FRAX collateral ratio was ~87% Brief depeg to $0.97; Frax moved to increase collateral ratio toward 100%; V3 redesigned to be near-fully collateralized

H.4 Layer 2 Scaling Solutions and Bridges

H.4.1 Comparison Matrix

Dimension Arbitrum One Optimism (OP Mainnet) zkSync Era StarkNet
Launch date Aug 2021 (mainnet) Dec 2021 (mainnet rebrand) Mar 2023 (mainnet alpha) Nov 2022 (mainnet alpha)
Rollup type Optimistic rollup Optimistic rollup ZK rollup (zkSNARK-based) ZK rollup (STARK-based)
Proof system Fraud proof: any observer can challenge a posted state root within 7-day window; interactive multi-round challenge Fault proof: similar to Arbitrum but with single-round fault proof (Cannon); enabled on mainnet Oct 2024 Validity proof: every batch includes a cryptographic proof (zkSNARK) that the state transition is correct; verified on L1 Validity proof: every batch includes a STARK proof; verified on L1 via SHARP (Shared Prover)
Finality 7 days (optimistic dispute window) for L1 finality; ~10 min for "soft finality" (sequencer confirmation) 7 days (dispute window); ~2 sec for sequencer confirmation ~1 hour for L1 finality (proof generation + verification); ~1 sec for sequencer confirmation ~2-6 hours for L1 finality (STARK proof generation is slower but more scalable); ~5-15 sec for sequencer confirmation
EVM compatibility Nitro: near-full EVM equivalence; deploy existing Solidity contracts with minimal/no changes Bedrock: EVM equivalence (not just compatibility); designed to be as close to L1 EVM as possible zkEVM: compiles Solidity to custom zkEVM bytecode; 95%+ compatibility but edge cases exist (some opcodes differ) Not EVM-compatible; uses Cairo language (STARK-friendly); Solidity transpilation available (Kakarot zkEVM) but not native
Programming language Solidity / Vyper (same as Ethereum) Solidity / Vyper (same as Ethereum) Solidity / Vyper (compiled to zkEVM bytecode) Cairo (native); Solidity via Kakarot (experimental)
Sequencer Centralized (Offchain Labs) with decentralization roadmap; BOLD protocol for permissionless validation Centralized (Optimism Foundation) with decentralization roadmap; Sequencer profits fund public goods (RetroPGF) Centralized (Matter Labs) with decentralization roadmap Centralized (StarkWare) with decentralization roadmap
Transaction cost (Q1 2025) ~$0.01-0.10 (post-EIP-4844 blobs) | ~$0.01-0.10 (post-EIP-4844 blobs) ~$0.01-0.05 (validity proofs compress data efficiently) | ~$0.01-0.05 (STARK compression is highly efficient for batch sizes)
TVL (Q1 2025) ~$10B | ~$6B ~$0.9B | ~$0.3B
Governance token ARB (governance + staking) OP (governance + RetroPGF funding) ZK (airdropped Jun 2024; governance) STRK (governance + staking + fee payment)
Ecosystem size Largest L2 ecosystem: GMX, Camelot, Radiant, Pendle; 500+ protocols Growing: Velodrome, Synthetix V3, Aave, Uniswap; Superchain vision (Base, Zora, Mode built on OP Stack) Emerging: SyncSwap, Maverick, ZKsync Name Service; native account abstraction Emerging: Ekubo, Nostra, zkLend; mathematically novel with Cairo
Bridge mechanism Native bridge: 7-day withdrawal; fast bridges available (Across, Stargate, ~2-20 min) Native bridge: 7-day withdrawal; fast bridges available Native bridge: ~1 hour withdrawal (proof verification); faster than optimistic rollups Native bridge: ~2-6 hours withdrawal (proof verification)
Data availability Posts transaction data to Ethereum L1 (calldata pre-4844; blobs post-4844) Posts transaction data to Ethereum L1 (blobs post-4844) Posts state diffs to L1 (not full tx data); more compressed than optimistic rollups Posts state diffs to L1; Volition mode: choice of on-chain or off-chain DA per transaction
Key risk Sequencer centralization; 7-day exit window means liquidity is locked; upgradable contracts controlled by Security Council multisig Same centralization risks as Arbitrum; OP Stack forks create ecosystem fragmentation risk ZK proof technology less battle-tested than optimistic rollups; compiler bugs could cause state inconsistencies Cairo ecosystem is small; developer adoption is a challenge; STARK proofs are computationally expensive to generate

H.4.2 Optimistic vs. ZK Rollups: Structural Trade-offs

Property Optimistic (Arbitrum, Optimism) ZK (zkSync, StarkNet)
Trust assumption At least one honest verifier must challenge fraud within 7 days Cryptographic: proofs are mathematically verifiable; no trust in validators
Withdrawal time 7 days (native bridge) Minutes to hours (proof verification time)
Computation cost Cheap (run transactions, only prove if challenged) Expensive (generate proof for every batch)
EVM compatibility Near-perfect (byte-for-byte compatible) Partial to full (zkEVM is an active research area)
Maturity Battle-tested since 2021; billions in TVL Mainnet since 2022-2023; still early but growing
Long-term prognosis Expected to merge with ZK (e.g., Arbitrum exploring ZK proofs for faster finality) Expected to reach full EVM equivalence; proof generation costs declining rapidly

H.4.3 Major Incidents

Solution Date Incident Impact
Arbitrum Jun 2022 Nitro upgrade temporarily halted transactions for ~5 hours during migration No funds lost; highlighted sequencer centralization risk
Arbitrum Dec 2022 $2M exploit of Lodestar Finance (built on Arbitrum) via oracle manipulation Protocol-level exploit, not Arbitrum infrastructure; Lodestar shutdown
Optimism Jun 2022 20M OP tokens sent to wrong address during Wintermute market maker distribution Wintermute recovered 17M; 1M sold by attacker; 2M returned voluntarily
Optimism Feb 2023 Sequencer downtime (~2 hours) during high Ethereum gas prices Transactions delayed; no funds lost; highlighted single-sequencer risk
zkSync Jun 2024 ZK token airdrop controversy — 17.5% allocated to insiders; Sybil filtering criticized as insufficient Community backlash; token price declined ~70% within weeks of airdrop
StarkNet Nov 2022 Mainnet alpha had multiple reorg events during early operation No funds lost; expected during alpha; demonstrated STARK proof system resilience

H.5 Cross-Category Risk Comparison

Risk Type DEXs Lending Stablecoins L2/Bridges
Smart contract bug HIGH — AMM logic, pool factories HIGH — liquidation logic, oracle integration MEDIUM — well-audited mature contracts MEDIUM — rollup contracts, bridge logic
Oracle manipulation LOW (AMMs are their own oracle) HIGH — lending depends on accurate prices MEDIUM — PSMs and collateral rely on price feeds LOW — L2s don't rely on external oracles
Governance attack MEDIUM — fee changes, protocol upgrades HIGH — risk parameter changes can be weaponized HIGH — stability fee and collateral changes affect peg MEDIUM — upgrade authority typically multisig
Regulatory MEDIUM — SEC scrutiny of DEX frontend operators LOW — lending protocols less targeted HIGH — stablecoins are primary regulatory target MEDIUM — bridges involved in money transmission arguments
Systemic/contagion HIGH — DEX failures cascade through arbitrage networks HIGH — bad debt cascades to other protocols using same collateral CRITICAL — stablecoin failure affects entire DeFi ecosystem HIGH — bridge exploits can drain cross-chain liquidity
Centralization LOW — most DEXs are permissionless MEDIUM — governance multisigs can pause VARIES — USDT/USDC centralized; DAI governance-controlled HIGH — single sequencer operators

H.6 How to Read This Appendix Over Time

DeFi protocols evolve rapidly. By the time you read this, specific TVL figures, fee structures, and governance parameters will have changed. What remains durable:

  1. Architecture types are stable: constant-product AMMs, concentrated liquidity, pool-based lending, vault-based lending, and over-collateralized vs. fiat-backed stablecoins are structural categories that persist even as specific implementations change.

  2. Trade-offs are persistent: Capital efficiency vs. complexity. Decentralization vs. performance. Composability vs. isolation. These trade-offs drive design decisions in every generation of protocols.

  3. Failure patterns repeat: Oracle manipulation, governance attacks, liquidity crises during market stress, and bridge exploits are recurring categories. The specific protocol changes; the vulnerability class does not.

  4. Verify current data at DefiLlama (defillama.com) for TVL, Dune Analytics (dune.com) for on-chain metrics, and each protocol's official documentation for current parameters.

For a systematic framework for evaluating any DeFi protocol — including ones that do not yet exist — see Chapter 35 (Evaluating Blockchain Projects) and Appendix F (Crypto Project Evaluation Rubric).