Routing & execution

Why split routers compare marginal output

Understand why a split optimizer compares the extra output from the next unit rather than ranking routes by their average rate alone.

Marginal output is the additional output obtained from a small additional input at the current allocation. A split optimizer uses this idea because the first part of a route can be attractive even when its later units are not.

A hypothetical allocation decision

Suppose Route A has already received some input. Adding the next unit there would produce 0.90 B. Giving that unit to Route B instead would produce 0.96 B. If other conditions and activation costs are equal, moving the unit to B improves total output.

The average return of Route A's earlier allocation does not answer that next-unit question. Those earlier units may have executed at stronger terms. The decision concerns the incremental effect of changing the allocation.

Where equalization comes from

For independent smooth output curves, no binding size caps and an interior optimum, used routes tend to reach equal marginal output after applicable variable fees. Otherwise a small reallocation from a weaker marginal route to a stronger one could improve the objective.

This is a mathematical explanation under stated assumptions, not a claim that every production router uses one particular algorithm. The efficient CFMM routing paper formalizes marginal-price interpretations within its optimization framework.

Why real systems need more conditions

A route can have a maximum size, a discrete maker offer or a new fixed execution cost. Concentrated-liquidity boundaries can alter the local curve. Shared pools also couple what would otherwise look like independent allocations.

Those features can prevent a simple equal-marginal rule from fully describing the chosen route. The optimizer must solve the actual constrained problem.

For readers interpreting a split, this explains why allocations need not match pool size or divide equally. A route can receive a small portion because its first units are competitive, then stop once its next units become less useful than another branch's.

The right question is therefore not “Which route has the best average from zero?” but “What happens to the total result if the allocation changes?” That is the role marginal analysis plays.

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. An Efficient Algorithm for Optimal Routing Through Constant Function Market Makers

    Network routing, utility objectives and optimization under CFMM constraints.

    https://arxiv.org/html/2302.04938v1
  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

What does best mean to a swap router? Why a router does not inspect every possible path Why split routes cannot treat a shared pool as independent