Skip to content

AMM vs Order Book Exchange Difference: Where DEX Prices Come From

Most decentralized exchanges (DEXs) use automated market makers (AMMs): your trade changes a pool’s reserves, and those reserves determine your execution price. shiba swap uses this pool model for swaps such as SHIB/WETH; some DEXs, including dYdX, use order books that match buyers and sellers. Pools can quote swaps from deposited liquidity without a market maker posting a new order for each trade.

  • Input: The amount you want to trade.
  • Liquidity: Tokens in a pool, or buy and sell orders waiting in a book.
  • Output: The amount you receive and the average price you pay.

In a constant-product AMM, the two token reserves are called x and y, and their product stays at x·y = k during a swap, before fees. Buying SHIB takes SHIB out of the pool and adds WETH. With less SHIB and more WETH remaining, the pool quotes a higher WETH price for the next SHIB. A larger purchase moves the reserves further, so its average fill is worse than the price shown before the trade.

Pool Depth Sets Your Fill

In a SHIB/WETH pool, the share of reserves you buy determines how far the price moves. Say a pool holds 1,000,000 SHIB and 100 WETH. Its starting spot price is 0.0001 WETH per SHIB. Buying 10,000 SHIB removes 1% of its SHIB reserve. Keeping x·y constant requires about 1.0101 WETH: the average price is about 1.01% above the starting price, and the spot price after the swap is about 2.03% higher. Those figures exclude fees.

Now keep the same starting price and 10,000 SHIB purchase, but use a pool with 10,000,000 SHIB and 1,000 WETH. The purchase removes only 0.1% of its SHIB reserve. Its average price is about 0.10% above the starting price, before fees. The deeper pool gives a better fill because the same trade changes its reserve ratio less.

An order book works through resting orders instead. Buyers post bids and sellers post asks; a trade matches available orders by price, then by time at the same price. If sellers have posted all 10,000 SHIB at the current best ask, a buyer can fill there. If that quantity isn’t available, the trade reaches higher asks or waits for another seller. That price depends on active makers placing orders, while an AMM continues quoting from its reserves.

For an everyday swap on an AMM such as Uniswap or SushiSwap, look at the estimated price impact and amount received. On an order-book DEX, look at the spread and the quantity offered near the best price.

What is a limit order on a DEX?

A limit order sets the highest price you’ll pay to buy, or the lowest you’ll accept to sell. On an order book, it can wait for a matching trader instead of filling immediately.

Why do AMMs need liquidity providers?

AMMs need liquidity providers to deposit the tokens that swaps draw from. More reserves generally mean less price impact for a trade of the same size.

Before your next swap, identify whether the DEX shows pool liquidity or a bid-and-ask book. That tells you which depth matters to your fill.