Crypto NationThe whole coin market as one nation🗺 Open the mapMap

In-depth essays · #25 / 50 · On-Chain Finance (DeFi), Stablecoins & RWA

Inside Decentralized Exchanges (DEXs): Automated Market Makers, Concentrated Liquidity, and Impermanent Loss

How the x * y = k formula replaced traditional order books on-chain—and why Uniswap built Unichain

Centralized exchanges match buyers and sellers using high-frequency limit order books. On early Ethereum, posting and canceling orders on-chain cost too much gas—inspiring the invention of the Automated Market Maker (AMM), where a simple mathematical curve prices trades 24/7.

1. The Constant Product Formula (x * y = k): Trading Against a Smart Contract Pool

Instead of matching individual counterparties, an AMM holds reserves of two tokens (say ETH and USDC) inside a liquidity pool governed by x * y = k. Buying ETH from the pool reduces x and increases y, automatically sliding the price upward along the curve.

2. Liquidity Providers (LPs) and the Reality of Impermanent Loss

Anyone can deposit token pairs into a pool as a Liquidity Provider (LP) to earn swap fees. However, when the market price of the two assets diverges sharply, arbitrageurs rebalance the pool—leaving LPs with less of the outperforming asset than if they had simply held both tokens idle (impermanent loss).

3. From Full-Range Pools to Concentrated Liquidity (v3) and Hooks (v4)

Uniswap v3 allowed LPs to concentrate their capital within custom price ranges for dramatically tighter spreads, while v4 introduced customizable smart contract Hooks for dynamic fees and on-chain limit orders.

4. Why Uniswap Labs Launched the Unichain District

Because slower block times expose AMM liquidity providers to arbitrage losses (Loss-Versus-Rebalancing), Uniswap Labs launched Unichain in February 2025 with 1-second blocks, 250ms sub-blocks, and TEE-verified priority ordering.

Related districts in the city

Related glossary terms

This essay is an explainer written to help you read the city; it is not investment advice. Facts on this page are as of 2026-10 and may change. If you spot a mistake, please tell us through the contact page.