Routing & execution

Why a router does not inspect every possible path

Explain candidate pruning, hop bounds, allocation granularity and why a practical quote is not a proof of global market optimality.

A practical router searches a bounded set of alternatives using available information and computation time. It can produce a strong route without proving that no better path exists anywhere in the market.

The search grows quickly

Adding a token creates potential intermediate paths; adding a pool creates alternative connections; allowing splits adds allocation combinations. The router also needs current data to evaluate those alternatives. Searching more is useful only if the result arrives while the information remains relevant.

Uniswap's routing configuration contains candidate-pool selection, maximum hops, split limits and allocation granularity. These are explicit examples of practical search boundaries, not a universal configuration for every service.

What each restriction changes

  • Candidate pruning: removes some pools before detailed evaluation.
  • Hop limits: exclude long paths.
  • Split limits: cap the number of parallel branches.
  • Allocation granularity: tests portions at selected increments rather than every real-valued fraction.

A hypothetical search using 10% allocation increments may never test a 63%/37% split exactly. That does not establish that 63%/37% is meaningfully better; it identifies one approximation in the search.

Mathematical optimum and live service differ

Research on optimal CFMM routing distinguishes tractable formulations from problems including fixed execution costs. Such results require specified models and inputs. A live aggregator additionally faces data freshness, integrations and operational deadlines.

When a service describes an optimal route, read the scope of that claim. Best among supported and evaluated paths at a snapshot is different from best across every possible venue at eventual execution time.

For evaluation, compare against a clearly defined feasible alternative set. An unexplained assertion of global optimality is hard to verify; a disclosed objective, state reference and search boundary make the claim assessable.

Sources & verification (2)

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

  1. Uniswap smart-order-router: alpha-router.ts

    Candidate-pool selection and configurable hop and split limits.

    https://github.com/Uniswap/smart-order-router/blob/main/src/routers/alpha-router/alpha-router.ts
  2. Optimal Routing for Constant Function Market Makers

    Routing across CFMM networks; fixed execution costs alter optimization complexity.

    https://web.stanford.edu/~boyd/papers/cfmm_routing.html

Continue reading

Why split routes cannot treat a shared pool as independent How quote sampling estimates an AMM's output curve How a maximum-hop rule changes routing