I came across this point in my notes again, so I’m sharing it.

When swapping tokens on a decentralized exchange, there are no orders to place and no counterparties matching trades one by one—yet prices can still be calculated at any time. This is made possible by AMMs (automated market makers).

Token mentioned in the article: $UNI Current price: 4.926 (24h -5.1%).

【How is it different from an order book?】

Most centralized exchanges use an order book: buyers and sellers submit orders with their prices, and the matching engine pairs orders with compatible prices to execute trades.

AMMs take a different approach: they set up a liquidity pool containing two tokens in advance. Traders swap directly with the pool, and a formula automatically determines the price.

【The Constant Product Formula】

Uniswap V2 uses the constant product formula x × y = k: ignoring fees, the product of the quantities of the two tokens in the pool stays the same before and after a swap.

The more of a token is bought from the pool, the less remains, and the higher its price becomes. So the more you buy in a single trade, the higher the average execution price—that’s where price impact (slippage) comes from.

【Who Provides the Pool’s Funds】

The funds in a pool come from liquidity providers (LPs). They deposit two tokens in proportion to the pool’s current prices and earn a share of the swap fees. Uniswap V2 charges a 0.3% fee on every swap, which initially went entirely to LPs. Governance later enabled a protocol fee, so the protocol takes a portion from Ethereum mainnet V2 pools (since late 2025, 0.25% goes to LPs and 0.05% to the protocol).

Uniswap V3 introduced concentrated liquidity, allowing LPs to provide liquidity only within price ranges they choose, making their capital more efficient. But once the price moves outside that range, they no longer earn fees.

【How Prices Stay in Line with the Outside Market】

An AMM itself has no idea what the price is elsewhere; its quotes are determined solely by the ratio of the two tokens in the pool. When its price diverges from prices in other markets, arbitrage traders buy low and sell high, pushing the price back toward parity.

【In Closing】

Once you understand AMMs, concepts like slippage, pool depth, and impermanent loss all connect: they’re really just different ways the same formula plays out under different conditions. Only invest what you can afford, and leave yourself room to maneuver.

If anything wasn’t clear, leave a comment and ask me.

Personal notes; not investment advice.