# Verifying beats solving: the asymmetry that makes imperfect routing safe

> Canonical: https://blazephoenix.xyz/learn/verifying-beats-solving/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-11-16

The contract never asks whether the route is the best one. It asks whether the amount that arrived is at least the floor, an exact question answered from balance deltas. A search that misses the best route costs the user some price, never the floor.

Short answer: because the contract never asks whether the route is the best one. It asks whether the amount that arrived is at least the floor, and that question has an exact answer read from balance deltas. A search that misses the best route costs the user some price. It cannot cost the user the floor.

The whitepaper states this as the first of two laws under the meta-equation (section 2.9): the Solver returns a plan that approximates the argmax, finding the argmax is an approximate search over routes and splits, and the constraint the Router enforces is a different kind of object, the delivered amount against the floor.

## Two problems, two different kinds of answer

Routing and settlement look like one problem but are two. The first is an optimisation, the second is a predicate. The table puts them side by side.

## Why the safety predicate does not mention the optimum

Write the plan the Solver returned as a-hat and the true optimum as a-star. The safety predicate S is evaluated on a-hat itself and never refers to a-star. So for every plan that passes S, settlement is safe, whatever the distance between a-hat and a-star.

The quality of the plan, mu of a-hat, is at most mu of a-star by definition of the argmax. An imperfect search therefore costs price, never safety. This is also why the whitepaper never claims the route is optimal: it claims the route is checked.

## What the check reads

The Router measures before it believes. At entry it takes baselines for the input and output tokens, so dust and donations already sitting in the contract are excluded. At settlement it takes the output-token delta, charges the fee, transfers the net to the recipient, measures the recipient's own balance delta and enforces the user minimum on that delivered amount (section 11.6).

Nothing in that sequence reads the Solver's expected output as a fact. The Solver's plan carries a floor it attests, but the Router enforces the floor on realised output.

## The numbers that bound the search

The search is bounded by constants, not by hope. When a swap asks for an in-transaction solve (`swapBestExactIn`), the Solver runs under a gas budget of 14,700,000 (`SOLVE_GAS`), and its capacity walk is capped at 8,000,000 (`WALK_CAP`). If the in-frame Solver reverts without data, the Router refuses with `RouterE(17)` rather than guessing. The other three doors take a route you computed off-chain.

The bound has a consequence for the claim above. A search that runs out of budget returns a worse plan or none. It does not return a plan that skips the floor.

## What this does not claim

It does not say the plan is the best available. It says the plan is checked against a floor that the contract measures. Whether your fill was near the best is a different, measurable question: the whitepaper treats it as fidelity and prints it per chain.

It also does not say the floor is tight. The floor is a bound on loss, set from the same arithmetic the Router enforces, and a manipulated pool fails it instead of hiding inside a healthy total.

**Verify it yourself:** sed -n '2515p;2525p' src/BlazePhoenixCore.sol   # SOLVE_GAS and WALK_CAP, in a checkout of the V2 repository at commit 969bcc6. Then run the invariant invariant_DeliveredNeverBelowTheProtocolFloor (test/BlazePhoenixRouter.invariant.t.sol:441 at the same commit) with the repository's own test setup. Reading: section 2.9 of the 2.4 whitepaper.

Related: https://blazephoenix.xyz/learn/result-verification-primitive/ · https://blazephoenix.xyz/learn/meta-equation-projection/ · https://blazephoenix.xyz/learn/closed-form-optimal-split/
