Routing & execution

Why the best route changes with trade size

See why the same pair can use a direct pool for one amount and a split or multi-hop route for another.

The best route can change when the requested amount changes because liquidity sources do not offer unlimited capacity at a fixed rate. A path that wins for the first few units may have weaker terms for the rest.

Think in output curves

Imagine two hypothetical sources. Source A starts at a slightly better rate but has shallow capacity. Source B begins less favorably yet absorbs additional size more smoothly. Small orders can prefer A, larger orders can prefer B, and intermediate orders can benefit from combining them.

This is a routing explanation rather than a trade-sizing recommendation. The key point is that each candidate supplies a function of the amount, not a single immutable rate.

Uniswap's pricing guide derives output from reserves and quantity. Its smart-order-router searches paths and splits for the given request.

Several mechanisms can change the winner

  • A constant-product path becomes less favorable as input moves the reserves.
  • A concentrated-liquidity path crosses into a region with different active liquidity.
  • A dealer offer reaches its permitted size.
  • An additional path becomes worthwhile under the router's execution-cost objective.

These effects can occur together. The route change is not necessarily a sign that one of the quotes was wrong.

Do not scale the path as well as the number

If a quote for 10 A uses Pool One, multiplying its output by ten is not a quote for 100 A. Keeping the same route and recalculating is better, but a complete search can reveal that another route now wins.

A fair comparison of routing services therefore holds size fixed for each observation. To understand behavior across sizes, request fresh routes for each amount and retain their structures. That separates changes in allocation from changes in market state.

The route belongs to a fully specified request at a particular snapshot. Treating it as a permanent recommendation for a token pair discards the information that made the selection meaningful.

Sources & verification (4)

Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.

  1. Uniswap v2 Pricing

    Reserve pricing, invariant enforcement and exact swap modes.

    https://developers.uniswap.org/docs/protocols/v2/concepts/pricing
  2. Uniswap Smart Order Router

    Routing searches consider split paths and gas costs.

    https://github.com/Uniswap/smart-order-router
  3. Concentrated Liquidity

    Active range liquidity, tick boundaries and liquidity changes.

    https://developers.uniswap.org/docs/get-started/concepts/liquidity-providers/concentrated-liquidity
  4. Orders — 0x Protocol 4.1 documentation

    Version-specific order fields: token identity, amounts, maker/taker, expiry and RFQ.

    https://docs.0xprotocol.org/en/latest/basics/orders.html

Continue reading

Why split routers compare marginal output What does best mean to a swap router? Why a router does not inspect every possible path