BLOCKCHAIN

DeFi & Web3: Real Applications

DeFi replaces financial intermediaries with smart contracts. AMMs eliminate order books; lending protocols eliminate credit officers; DAOs eliminate boards.

1DeFi: Decentralised Finance

Decentralised Finance (DeFi) is the category of financial services built on public blockchains. Unlike traditional finance, DeFi protocols are open-source, permissionless, and non-custodial — users interact directly with contracts without handing over control of their funds. By 2024 the ecosystem had locked over $100B in value across lending, trading, and yield protocols.

DeFi is composable: Uniswap liquidity can be used as collateral in Aave, which can be used to borrow stablecoins on MakerDAO, which can be re-deposited in a yield strategy on Yearn. This money lego property creates complexity — and systemic risk — that traditional finance lacks.

DEX
Decentralised Exchange. Swaps tokens via AMM formula with no order book, no counterparty, and no account required (Uniswap, Curve).
Lending
Deposit tokens to earn yield; borrow others against over-collateralised positions. If collateral drops below threshold, position is liquidated (Aave, Compound).
Stablecoin
Token pegged to USD. Algorithmic (DAI — collateral backed), centralised (USDC — 1:1 fiat reserves), or hybrid. Backbone of DeFi liquidity.

2Automated Market Makers: x·y = k

Traditional exchanges use order books: buyers post bids, sellers post asks, and a matching engine fills orders. Uniswap (2018) replaced this with a mathematical formula: x·y = k. Two tokens form a liquidity pool. The product of their reserves must remain constant. This means: the more you buy of token X, the more expensive each additional unit becomes — a built-in price impact mechanism.

Pool: 1000 ETH, 2,000,000 USDC → k = 2,000,000,000. You want to buy 10 ETH. New ETH reserve = 990. New USDC reserve = k / 990 = 2,020,202. You paid 20,202 USDC for 10 ETH → effective price $2,020.2/ETH vs. spot $2,000. The 1% difference is price impact — larger trades create larger slippage.

✓ AMM advantages

  • ✓ Always has liquidity — any size trade executes immediately
  • ✓ No order matching infrastructure required
  • ✓ Liquidity providers earn fees passively
  • ✓ Permissionless — list any token pair without approval

✗ AMM risks

  • ✗ Impermanent loss: LPs lose vs. just holding if prices diverge significantly
  • ✗ High price impact on large trades
  • ✗ MEV (Maximal Extractable Value): bots front-run large swaps

3NFTs: Non-Fungible Tokens

An NFT is a token whose on-chain record is unique. While 1 ETH is identical to any other ETH (fungible), each NFT has a distinct ID. The ERC-721 standard defines this: a contract maps token IDs to owner addresses, and ownership is transferred by calling transferFrom. NFTs prove provenance and ownership of digital (or physical) assets on-chain.

✓ Legitimate NFT use cases

  • ✓ Event tickets — prevents duplication, enables secondary market royalties
  • ✓ In-game assets — provable ownership, cross-game portability
  • ✓ Real estate tokenisation — fractional ownership on-chain
  • ✓ Art royalties — creators earn % on every secondary sale automatically

✗ NFT limitations

  • ✗ The token is on-chain; the art usually isn't — IPFS links rot
  • ✗ Owning an NFT doesn't convey copyright by default
  • ✗ High speculation often divorced from underlying utility

4DAOs and On-Chain Governance

A DAO (Decentralised Autonomous Organisation) is an organisation whose rules are encoded in smart contracts. Token holders vote on proposals; if a proposal passes, the contract executes its effects automatically — no CEO can veto, no board can delay. MakerDAO governs the DAI stablecoin; Uniswap DAO controls a $3B treasury and protocol parameters.

$100B+ TVL
Total Value Locked in DeFi protocols at peak (2021). Even after the bear market, $50B+ remained (2024).
Flash Loan
Borrow unlimited funds, use them, and repay in a single transaction. If repayment fails, everything reverts. Enabled by atomic composability.
Governance Token
Token granting voting rights in a DAO. Holders vote on protocol upgrades, fee parameters, treasury allocation. Often also confers economic rights.
Constant product AMM: simulate a Uniswap-style pool

Recall check

0 of …

Say the answer out loud before revealing — recalling is what makes it stick.

  1. What is the AMM invariant and why does it create price impact?

  2. What is impermanent loss?

  3. What is a flash loan?

  4. What is a DAO?