An improved quote offsets extra gas only when the additional output is worth more than the additional separate costs. Compare the difference between the alternatives, not each route's entire transaction cost in isolation.
The break-even calculation
Assume two hypothetical quotes for the same input. Route A returns 1,200 tokens and requires $0.50 of separate costs. Route B returns 1,206 tokens and requires $2.00. The extra cost is $1.50, and B's extra output is six tokens.
If each output token is valued at $0.20, the additional output is worth $1.20. Route A leaves $0.30 more net value. At $0.30 per token, the six additional tokens are worth $1.80 and Route B leaves $0.30 more.
Required extra output = extra separate cost / output-token price
At $0.20 per token: $1.50 / $0.20 = 7.5 tokensRoute B must therefore provide more than 7.5 additional tokens under the $0.20 valuation to win strictly on expected net value. Equality gives a tie before uncertainty.
Use consistent cost boundaries
Include any additional paid preparation required for one route. Exclude fees already reflected in each receiving amount. The network fee calculation is separate from the output quantity, unless the specific service explicitly deducts or funds that payment through another mechanism.
Allow for estimate uncertainty
If B's apparent advantage is two cents while its fee estimate can change by much more, the arithmetic is correct but the conclusion is fragile. Show the break-even amount and the plausible range of separate costs.
This analysis does not claim that either quote will remain available. Refresh comparable quotes at the intended size and record the same observation time. The decision boundary is useful precisely because it states how much deterioration would reverse the ranking.
Sources & verification (1)
Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.
- Ethereum gas and fees: technical overview
Gas cost calculation, maximum fee versus actual cost, and fees for executed failed transactions.
https://ethereum.org/developers/docs/gas/