09 — DeFi (Decentralized Finance)

Aplicações financeiras em smart contracts: AMMs, lending, derivatives, stablecoins, RWA, perpetuals, restaking. TVL combinado: ~US$ 200B (mai/2026).


1. Pilares

Categoria Função Top protocolos
DEX (AMM) Trocas spot Uniswap, Curve, Balancer, PancakeSwap, Aerodrome
DEX (orderbook) Order-book trading dYdX, Hyperliquid, Drift, Serum
Lending/Borrowing Empréstimos colateralizados Aave, Compound, Morpho, Spark
Derivatives / Perps Futuros perpétuos Hyperliquid, dYdX, GMX, Vertex, Drift
Stablecoins Tokens pegged ao USD USDT, USDC, DAI, ENA, FRAX, crvUSD
Liquid staking (LSTs) ETH/SOL stake líquido Lido, Rocket Pool, Jito
Liquid restaking (LRTs) EigenLayer stake líquido Ether.fi, Renzo, Puffer
Yield aggregators Otimização passiva Yearn, Beefy, Convex, Aura
Bridges Cross-chain LayerZero, Wormhole, Stargate, Across
Oracles Dados off-chain Chainlink, Pyth, RedStone, API3
RWA Real-world assets Ondo, Centrifuge, MakerDAO, BlackRock BUIDL
Insurance Cobertura smart contract Nexus Mutual, InsurAce
Prediction markets Apostas sobre eventos Polymarket, Kalshi (US-regulated)
DAOs / Governance Coordenação on-chain Snapshot, Tally, Aragon, Safe

2. AMMs (Automated Market Makers)

Constant-product (Uniswap v1/v2)

$\(x \cdot y = k\)$

Pool com \(x\) tokens A + \(y\) tokens B; produto constante. Swap de \(\Delta x\) tokens A: $\(\Delta y = y - \frac{k}{x + \Delta x \cdot (1 - \text{fee})}\)$

Fee (0.3% Uniswap v2) acumula no pool, beneficiando LPs.

Uniswap v1 (nov/2018)

  • Hayden Adams (ex-Siemens engineer).
  • ETH ↔ ERC-20 only.
  • 0.3% fee.
  • Hello-world AMM.

Uniswap v2 (mai/2020)

  • Token-token pairs (qualquer ERC-20 ↔ qualquer ERC-20).
  • Flash swaps: borrow + return em mesma tx.
  • TWAP price oracles built-in.

Uniswap v3 (mai/2021)

  • Concentrated liquidity: LPs choose price ranges (capital efficient).
  • Fee tiers: 0.05%, 0.3%, 1% (later 0.01%).
  • Non-fungible LP positions (NFTs).
  • Inspirou copies em todo lugar (PancakeSwap v3, etc.).

Uniswap v4 (jan/2024)

  • Hooks: pre/post swap callbacks → custom AMM logic per pool.
  • Singleton contract: todos pools em um contrato. Gas saving.
  • Flash accounting: net deltas instead of intermediate transfers.
  • Hooks enable: dynamic fees, custom oracles, MEV-protection, on-chain limit orders.

Curve

Michael Egorov 2020. Stableswap formula: $\(\sum x_i + (D \prod 1) = ...\text{(invariant blends sum + product)}\)$

Otimizado para assets de preço próximo (USDTUSDCDAI; ETH/stETH). Slippage minimal em meio do range, growth fora.

  • CRV: governance token.
  • veCRV (vote-escrowed): lock CRV para boost rewards + governance weight. Pioneer "ve-tokenomics".
  • Curve Wars: Convex acumulou veCRV → controla emissões → protocols (Frax, Yearn) bid for Convex influence.

Balancer

  • Weighted pools (multi-asset, custom weights).
  • Stable pools (Curve-like).
  • Boosted pools (composable LP).
  • CoW Protocol (related entity): batch auction MEV-resistant.

PancakeSwap

BSC primary (later multi-chain). Uniswap fork. Largest DEX em BSC. Cake token.

Aerodrome (Base)

Velodrome fork em Base. ve(3,3) tokenomics. Top DEX em Base — TVL ~US$ 1B.

SushiSwap

Vampire-attacked Uniswap v2 em set/2020. Drama, rollercoaster. Multi-chain, declined.

Maverick, Trader Joe v2.1, Camelot

Concentrated liquidity variations.


3. Stableswap variants

Specialized for stable assets:

  • Curve (above).
  • Saddle: Curve fork (defunct as major).
  • Ellipsis (BSC Curve fork).

4. Orderbook DEX

dYdX

  • v3 (StarkEx L2, 2021–2023): Top decentralized perp DEX initially.
  • v4 (Cosmos appchain, 2023): migrated. Off-chain orderbook + on-chain settle. ~US$ 1B/day volume.

Hyperliquid

  • App-specific L1 (custom HyperBFT consensus).
  • Top decentralized perp DEX 2024-2026. ~US$ 5-10B daily volume.
  • HYPE token TGE nov/2024.

Drift, Vertex, Serum (legacy)

Solana-based orderbook DEXes.

Aevo

Optimistic rollup focused on options + perps.


5. Lending

Compound (jun/2018)

  • Pioneer: floating-rate lending pools.
  • COMP token (jun/2020) initiated liquidity mining = DeFi summer.
  • Compound III (USDC-base) 2022.

Aave (formerly ETHLend)

  • v1 (2020), v2 (2020), v3 (2022).
  • Multi-collateral pools.
  • Flash loans: borrow + repay em 1 tx (no collateral).
  • eMode: same-class assets boosted LTV.
  • Isolation mode for new assets.
  • Multi-chain.

Morpho

  • Morpho Optimizer (legacy): peer-to-peer matching atop Aave/Compound.
  • Morpho Blue (jan/2024): minimal isolated lending markets, 650 lines code, immutable.
  • MetaMorpho vaults: curated allocations.
  • Top growth DeFi 2024-2025. TVL ~US$ 8B.

Spark (MakerDAO)

Aave fork by MakerDAO/Sky. DAI-centric. SubDAO of Sky ecosystem.

Outras

  • Euler v2 (relaunched após hack 2023).
  • Silo Finance.
  • Radiant (omnichain lending via LayerZero).
  • Liquity (LUSD stablecoin lending).

6. Stablecoins

Centralized (custodial)

Token Issuer Reserves Chain dominante Marketcap (mai/2026)
USDT (Tether) Tether Ltd Mix (treasuries, cash, BTC, etc.) Tron, Ethereum ~US$ 150B
USDC Circle (with Coinbase) Treasuries + cash Ethereum, Solana, Base ~US$ 60B
PYUSD Paxos for PayPal Treasuries + cash Ethereum, Solana ~US$ 1B
FDUSD First Digital Trust Treasuries BSC ~US$ 2B
TUSD TrustToken / Techteryx Treasuries Multi-chain ~US$ 0.5B
USDe (Ethena) Ethena Labs Synthetic delta-neutral (ETH + perps short) Ethereum ~US$ 5B

Crypto-collateralized

Token Protocol Backing
DAI MakerDAO / Sky Multi-collateral (ETH, RWA via private credit, USDC)
USDS Sky (rebrand DAI 2024) Idem
crvUSD Curve LLAMMA-AMM liquidations
GHO Aave Multi-collateral debt
LUSD Liquity ETH-only, immutable

Algorithmic / hybrid

Token Mechanism Status
FRAX Hybrid (partial collateral + protocol-controlled value) Active, ~US$ 0.6B
UST (Terra) Algorithmic via LUNA mint/burn DEAD 2022 (US$ 60B collapse)
USDe (Ethena) Delta-neutral synthetic Active, growing

USDe (Ethena) — case interessante

Guy Young 2023. Synthetic dollar:

  • Holds long ETH spot.
  • Shorts ETH perpetual futures (delta-neutral).
  • Funding rate revenue → yield to sUSDe stakers.
  • Risks: funding rate negative (custos), exchange counterparty (centralized perp venues).

ENA token. ~US$ 5B circulating mid-2026.

Stablecoin GENIUS Act (US, 2025)

Federal framework. Bank-issued stablecoins legitimized. Big banks (JPM, Citi) launching tokens.

Brasil — Drex (CBDC)

Digital Real do Banco Central. Phased rollout 2025-2026. Privacy concerns; regulator-controlled.


7. Liquid Staking (LSTs)

ETH staked via protocol → liquid wrapped token.

Token Protocol TVL
stETH Lido US$ 30B (30% all staked ETH)
rETH Rocket Pool ~US$ 4B
cbETH Coinbase ~US$ 2B
wstETH wrapped stETH (rebasing fix) derivative
frxETH Frax ~US$ 1B

Solana LSTs

  • JitoSOL: Jito-Solana validator client + MEV revenue. Top LST Solana.
  • mSOL: Marinade.
  • bSOL: BlazeStake.

Concerns

  • Lido centralization: 30% threshold debated; Vitalik wrote about ETH staking centralization risks.
  • Slashing risk: pool slashing affects all stakers.
  • Liquidity peg: stETH:ETH peg deviates em stress (mai/2022 LUNA stress: 0.94, recovered).

8. Liquid Restaking (LRTs)

Wrapping EigenLayer restaked ETH:

Token Protocol TVL
eETH Ether.fi ~US$ 3B
ezETH Renzo ~US$ 2B
pufETH Puffer ~US$ 1B
rsETH Kelp ~US$ 1B

Risks

  • Recursive leverage: LRT → LP em DeFi → re-collateralized.
  • AVS slashing risk propagates.
  • De-peg events (jan/2024 ezETH brief de-peg under conditions).

9. Yield aggregators

  • Yearn Finance (YFI): Andre Cronje. Fair-launch 2020 (no premine). Vaults strategically deploy capital.
  • Convex (CVX): Curve gauge bribes + boost.
  • Aura: Convex-style for Balancer.
  • Beefy: cross-chain auto-compounding.
  • Pendle: yield tokenization (split principal + yield).

10. Oracles

Smart contracts can't access off-chain data natively — oracles ponte.

  • Largest oracle network. Decentralized aggregator.
  • Price feeds: thousands of pairs.
  • VRF: verifiable randomness.
  • Automation (formerly Keepers): scheduled triggers.
  • CCIP: Cross-Chain Interoperability Protocol.
  • LINK token.

Pyth Network

  • Pull oracle: low-latency price feeds. Originally Solana, now multi-chain.
  • Publishers: Jane Street, CBOE, Cumberland, Susquehanna.
  • ~400 price feeds, ~80 chains.

RedStone

  • Modular oracle. On-demand or push.
  • Many integrations em LRT pricing.

API3

  • First-party oracles: data providers run own nodes (no aggregator middleman).
  • dAPIs.

UMA

  • Optimistic oracle: assert + dispute.
  • Used by Polymarket for resolution.

Outras

Tellor, DIA, Band, Nest.


11. RWA (Real-World Assets)

Tokenization de assets tradicionais. Growing fast 2024-2026.

BlackRock BUIDL (US Treasury fund tokenizado)

  • Launched mar/2024 em Ethereum.
  • US$ 500M+ AUM em 2025.
  • Distributed via Securitize.

Ondo Finance (ONDO)

  • USDY (yield-bearing US Treasury wrapper).
  • OUSG (institutional Treasury).
  • US$ 600M+ AUM.

Centrifuge

  • Real-estate, invoice financing tokenization.
  • Integrated with MakerDAO collateral.

MakerDAO RWA collateral

  • ~50% of DAI collateral em RWA (treasuries, US bank loans).
  • Sky (rebranded MakerDAO 2024) doubling down.

Backed Finance, Securitize, Polymath

Tokenization platforms.

TVL trend

US\( 8B em 2023 → US\) 50B em 2025 → US$ 100B+ esperado 2026.


12. Prediction markets

Polymarket

  • Polygon-based.
  • US$ 3.5B+ volume in 2024 election season.
  • USDC-denominated.
  • UMA optimistic oracle resolution.
  • Banned em US during 2022-2024 CFTC settlement; relaunched US 2025 sob Trump admin.

Kalshi

  • US-regulated event exchange (CFTC).
  • Not crypto-native but adjacent. Election markets approved 2024.

Augur (legacy)

Pioneer prediction market 2018. Defunct.


13. Insurance

Nexus Mutual

  • Member-owned mutual.
  • NXM token.
  • Coverages: smart contract, exchange, custody.
  • ~US$ 250M cover total active.

Outras

Sherlock, InsurAce, Bridge Mutual, Etherisc.


14. DAO governance

Snapshot

  • Off-chain voting (gasless via signed messages).
  • IPFS-hosted proposals.
  • Quadratic, weighted, delegations.
  • Used by 99% of token-voting DAOs.

Tally

  • On-chain executive (after Snapshot vote).
  • Governor contract integration.

Safe (Gnosis Safe)

  • Multisig wallet standard.
  • Used by 95% of DAOs for treasury.

Governance models

  • Token-weighted: 1 token = 1 vote. Crítica: plutocracy.
  • Quadratic voting: \(\sqrt{\text{tokens}}\) vote weight. Anti-whale.
  • Delegated: hold tokens, delegate vote (UNI, COMP, AAVE).
  • Conviction voting: longer hold = more weight (1Hive).
  • Optimistic governance: pass unless challenged.

Major DAOs

  • MakerDAO/Sky: complex, sub-DAOs (SparkDAO, etc.).
  • Uniswap DAO: UNI holders. Famously inactive on fee switch debate.
  • Aave DAO: GHO, V4, deployments.
  • Compound DAO: smaller activity.
  • Optimism Collective: Citizens' House (impact attestations) + Token House (technical).
  • ENS DAO.
  • GitcoinDAO.

Governance attacks

  • Beanstalk (apr/2022): flash-loan to acquire 67% voting power → drain treasury (US$ 182M).
  • Tornado Cash gov takeover (mai/2023).

15. Métricas DeFi

TVL (Total Value Locked)

DeFi Llama (defillama.com) is reference. ~US$ 200B (mai/2026). Top chains:

Chain TVL
Ethereum L1 ~US$ 80B
Solana ~US$ 12B
BSC ~US$ 10B
Tron ~US$ 8B (mainly USDT)
Base ~US$ 8B
Arbitrum ~US$ 7B
Bitcoin (BTCFi) ~US$ 5B
Sui ~US$ 3B
Avalanche ~US$ 2B
Outros ~US$ 65B

DEX volume

US$ 2-5B/day. Uniswap dominante (40%), seguido Aerodrome, Pancake, Curve.

Perp volume

US$ 8-15B/day. Hyperliquid dominante (50%), dYdX, GMX.

Stablecoin supply

~US$ 250B em 2026. USDT 60%, USDC 25%, restante 15%.


16. Key Innovations Timeline

Ano Innovation Protocol
2017 First DEX EtherDelta, Bancor
2017 First lending ETHLend (later Aave)
2018 First AMM Uniswap v1
2019 Stablecoin DeFi DAI multi-collateral
2020 Yield farming Compound COMP launch
2020 Vampire attack SushiSwap
2020 yToken / vault Yearn
2020 Stableswap Curve
2021 Concentrated liquidity Uniswap v3
2021 ve-tokenomics Curve veCRV; later Velodrome ve(3,3)
2022 Optimistic oracle UMA
2023 Restaking thesis EigenLayer
2024 Hooks (modular AMM) Uniswap v4
2024 Modular lending Morpho Blue
2024 Tokenized treasuries mainstream BlackRock BUIDL
2025 Intent-based DeFi Anoma, Brink, ChainKit

17. Anti-patterns / risks específicos DeFi

❌ Oracle manipulation via flash loan (use Chainlink TWAP, not spot). ❌ Reentrancy em lending (CEI pattern obrigatório). ❌ Front-running em swaps grandes (use private mempool ou TWAP execution). ❌ Slippage protection ausente. ❌ Approval unlimited persistente (use Permit2 / scoped). ❌ Liquidity providing sem entender impermanent loss. ❌ Stake em LRT recursive sem entender slashing exposure. ❌ Yield "100%+ APY" sem fonte real de rendimento (provavelmente Ponzi-token-emission).


18. Tools / dashboards

  • DeFi Llama (TVL, yields, prices).
  • Dune Analytics (custom queries).
  • Token Terminal (revenue, fees).
  • Nansen (on-chain analytics + smart money).
  • Arkham (entity labeling).
  • Etherscan, Basescan, etc. (block explorers).
  • DEXScreener (real-time DEX prices).
  • Zerion, DeBank, Zapper (portfolio dashboards).

19. Referência cruzada

  • L1s onde DeFi vive: 04-l1-bitcoin.md, 05-l1-ethereum.md, 06-l1-alt.md.
  • L2s scaling DeFi: 07-l2-scaling.md.
  • Smart contracts (linguagens, patterns): 08-smart-contracts.md.
  • Tokens (governance, vesting): 12-tokenomics.md.
  • DeFi hacks: 14-incidentes.md.
  • Regulação (SEC vs DeFi, MiCA): 13-regulacao.md.