The swap with no route in it: 196 bytes of calldata, and the solver runs inside the transaction
There are two ways to execute a routed swap: send the route, or send the question. One of them has a gap between "the route was good" and "the route runs". The other doesn't. This is a byte-level look at both, using the public contract source and a real route read from Base. Entry A: the route is calldata The Solver contract exposes findBestRoutePlan(tokenIn, tokenOut, amountIn) as a view…
The process of executing a routed swap can occur in two ways: sending the route or sending the question. This distinction has an important difference between the two methods. A detailed examination of both approaches, using the public contract source and a real route read from Base, reveals distinct byte-level differences. The Solver contract provides a function called findBestRoutePlan(tokenIn, tokenOut, amountIn) which anyone can execute with a free eth_call.
This function returns a plan consisting of hops and legs. When this plan is sent inside a transaction, it occupies more bytes (2308 bytes) than when the same plan is sent using swapBestExactIn (196 bytes). This difference arises because the swapExactIn calldata carries a Route struct containing the hops and details of each leg, while swapBestExactIn only requires the tokens, amount, minOut, recipient, and deadline.
This demonstrates that the flow of a routed swap can involve sending a route from a Solver at one block, and executing it in a subsequent transaction at a later block. However, during this period, the state of the pools may change, and the contract cannot re-plan for this possibility. If the plan no longer delivers the expected results (floors, minimums), the contract may refuse to settle the transaction.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.