How AMMs price your trade
An automated market maker has no seller waiting at a single sticker price. Your trade changes the pool's inventory as it executes, so size, depth, fees, and liquidity placement determine the average fill.
The short answer
An AMM holds two assets in a pool and uses a formula to quote exchanges between them. In the simplest constant-product design, the reserves follow x × y = k. Buying the token adds quote asset to one side and removes tokens from the other. Each next unit is therefore more expensive than the last.
The price shown before the trade is usually a spot or marginal price for a tiny amount. Your execution price is the average across the reserve changes caused by the full order, after the pool fee. The larger the order relative to available liquidity, the farther those two prices separate.
Constant product, in plain English
Imagine a pool with 100 SOL and 1,000,000 TOKEN. Ignoring fees, its constant is 100,000,000. If a trader adds 10 SOL, the token reserve must fall to roughly 909,091 to keep the product unchanged. The trader receives about 90,909 TOKEN.
Before
100 SOL / 1M TOKEN
After
110 SOL / 909,091 TOKEN
Output
≈ 90,909 TOKEN
The opening ratio implied 10,000 TOKEN per SOL. The order averaged about 9,091 TOKEN per SOL because it walked the curve. The next buyer sees a still worse marginal price unless someone trades the pool back toward prices elsewhere.
Real constant-product pools subtract a fee from the effective input before calculating output. That produces slightly less output than the no-fee example and sends the fee value to the pool or protocol according to its rules.
Three prices you should not collapse into one
Pre-trade spot price
The reserve ratio—or current active-liquidity state—before your order. It describes an infinitesimal next unit, not your entire order.
Average execution price
Total input divided by total output for the fill, including the curve movement created by your size and the pool fee.
Post-trade marginal price
The pool's price after your order changed its balances. This is where the next infinitesimal trade begins.
Price impact compares the pre-trade reference with the execution produced by your own order. Slippage refers to additional movement between quote and execution. The dedicated slippage and failed-swaps guide shows why those require different responses.
Depth matters relative to your size
“Has liquidity” is not a complete statement. A pool may be deep enough for a $50 trade and fragile for a $5,000 trade. Evaluate the proposed input against the reserves that can actually serve that direction of the swap. A large reserve of the token you are buying does not help if the paired asset or active price range is too shallow.
Splitting an order into smaller trades does not magically remove total curve impact if nothing restores the pool between them. It may reduce timing or submission risk, and outside arbitrage can replenish the price between fills, but repeated trades against the same unchanged curve reach roughly the same final reserve state while paying each transaction's costs.
The dedicated liquidity depth and exit capacity guide turns that relationship into a size-by-size sell plan.
Concentrated liquidity changes where the depth lives
Uniswap v3 and later designs let liquidity providers place capital inside chosen price ranges. The pool can therefore offer strong depth near the current price even when its total deposits look smaller than an older full-range pool. But the available depth can change abruptly when the trade crosses a range boundary.
The constant-product intuition still helps locally, but a single global reserve ratio no longer describes the whole route. The quote must walk through active liquidity ranges, pool fees, and possibly several pools. That is one reason an aggregator's executable quote is more useful than a token page's last price.
One wallet swap can cross several pools
A router may send TOKEN A through USDC or SOL before reaching TOKEN B, or split the input across multiple venues. Each hop has its own fee, curve, active depth, and failure dependency. The winning route is the one with the best protected wallet outcome at executable size—not necessarily the direct pool or the route with the fewest steps.
Use the Jupiter and DEX routing guide for how an aggregator finds those paths. Here, the execution lesson is simpler: compare final output, price impact, amount limit, expiry, and likely landing—not just the first displayed rate.
Read an AMM quote before signing
Confirm exact input and expected output
Check raw asset identity and decimals, then distinguish the route amount from any total wallet amount that includes wrapping, setup, or platform fees.
Measure size against executable depth
Use the quote's price impact at your actual size. Do not infer capacity from market cap, daily volume, or a screenshot of a smaller trade.
Inspect the path
Identify the pools, intermediate assets, pool fees, and whether one thin hop dominates the result.
Know the protected boundary
For exact-input trades, locate the minimum output. For exact-output trades, locate the maximum input. That is the onchain limit, not the headline quote.
Reconcile the fill
Record actual wallet input, output, pool and platform fees, network costs, and remaining inventory after success.
Primary sources
Turn pool math into trade evidence
Measure the execution you received.
Paste a public address to reconstruct inputs, outputs, fees, and remaining inventory from onchain activity. No wallet connection or signature is required.
Open the journal