Explore / Study / Economics / Crypto 685 words | 4 minutes

Crypto Ch6: DeFi & AMMs

  1. Chapter 6. DeFi: AMMs, liquidity, lending, liquidation, and oracle-based systems
    1. 6.1 What DeFi is
    2. 6.2 DEXs are not always order books
    3. 6.3 AMMs
      1. Constant product intuition
    4. 6.4 LPs and liquidity provision
    5. 6.5 Slippage
    6. 6.6 Single-sided liquidity provision
    7. 6.7 Impermanent loss
    8. 6.8 Lending protocols
    9. 6.9 Why overcollateralization is common
    10. 6.10 Liquidation
    11. 6.11 Oracles
    12. 6.12 Where DeFi yield comes from
    13. 6.13 Why DeFi is powerful
    14. 6.14 Why DeFi is dangerous
      1. Key takeaway

Chapter 6. DeFi: AMMs, liquidity, lending, liquidation, and oracle-based systems

6.1 What DeFi is

DeFi turns financial functions into programmable, composable protocols.

Instead of relying only on traditional institutions, DeFi protocols encode financial rules into smart contracts.

6.2 DEXs are not always order books

A decentralized exchange does not have to replicate the exact structure of a centralized order-book exchange.

The most important alternative is the AMM (Automated Market Maker).

6.3 AMMs

In an AMM, users trade against a liquidity pool rather than always matching with a human counterparty on an order book.

Constant product intuition

A simplified AMM often follows:

  • x×y=kx \times y = k

Here, the price emerges from the relationship between the two reserves in the pool.

This means:

  • Price is not fixed
  • Bigger trades move the pool more
  • Slippage increases with trade size relative to pool depth

A useful way to think about AMMs is that they replace the logic of “matching with someone else’s resting order” with “moving along a reserve curve.”

6.4 LPs and liquidity provision

Liquidity providers (LPs) supply assets to pools and earn fees generated by traders.

LPs are effectively providing inventory to the market.

They are not donating assets. They are taking market-making risk in exchange for fee revenue.

6.5 Slippage

Slippage is the difference between the expected price and the realized average execution price caused by the trade’s own impact on the pool or market depth.

This is a core concept because many users confuse slippage with fees. It is distinct. Fees are explicitly charged. Slippage arises from execution against a finite liquidity curve.

6.6 Single-sided liquidity provision

Many systems that appear to allow users to provide one-sided liquidity are actually doing two steps under the hood:

  • First, swap part of the asset
  • Then add balanced liquidity

6.7 Impermanent loss

LPs are not simply earning fees risk-free.

If the relative price of pool assets changes significantly, LPs can underperform a simple buy-and-hold strategy. This is called impermanent loss.

It is best understood as:

  • Not necessarily an absolute loss from the starting point
  • But a loss relative to holding the underlying assets without LPing

The mechanism is intuitive: as one asset appreciates, arbitrageurs remove it from the pool, leaving LPs with less exposure to the winning asset and more exposure to the lagging one.

6.8 Lending protocols

DeFi lending protocols are typically collateralized lending systems.

Users:

  • Deposit assets into pools
  • Post collateral
  • Borrow other assets against that collateral

6.9 Why overcollateralization is common

Because crypto collateral is volatile, protocols generally require users to deposit more value than they borrow.

This creates a buffer against price drops.

The system usually cannot rely on identity-based collection or off-chain legal enforcement, so it relies on collateral logic instead.

6.10 Liquidation

If collateral value falls too far relative to debt, the position can be liquidated.

Liquidation is not moral punishment. It is a risk-management mechanism designed to protect lenders and preserve protocol solvency.

A liquidation system is effectively an automated collateral enforcement system.

6.11 Oracles

Protocols need external price information to know whether collateral is still sufficient.

An oracle is the mechanism that brings external data, especially prices, into on-chain systems.

Oracle security is a critical dependency in DeFi.

The central challenge is not “getting data” but “getting data that is hard to manipulate and timely enough to be useful.”

6.12 Where DeFi yield comes from

Three broad sources:

  1. Real usage fees (e.g. trading fees, borrowing interest)
  2. Protocol subsidies (token emissions)
  3. Internal leverage / redistribution structures

Understanding which source dominates is essential.

6.13 Why DeFi is powerful

  • Open access
  • Composability
  • Transparency
  • Automation

6.14 Why DeFi is dangerous

  • Smart contract risk
  • Oracle risk
  • Liquidity risk
  • Governance and admin risk
  • Composability contagion risk

Key takeaway

DeFi is best understood as programmable finance with open access and visible rules, but every yield source and protocol design must be examined through the lenses of incentive structure, collateral logic, oracle dependence, and failure modes.

— Mar 25, 2026

Related: ,

Creative Commons License
Crypto Ch6: DeFi & AMMs by Lu Meng is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Permissions beyond the scope of this license may be available at About.