Fees & trade costs

Use a cost range when gas and quotes can change

Build favorable and adverse swap-cost scenarios when output quotes and network estimates can change before execution.

Use a scenario range when uncertain inputs can reverse a cost comparison. A range is not a probability interval unless you have data supporting the probabilities. It simply shows the economic result under explicitly different assumptions.

Build three cases

Assume a hypothetical $1,000 input and a quoted output worth $996. Separate execution costs are estimated at $1.50. Use the same valuation basis throughout:

CaseOutput valueSeparate costsShortfall
Favorable$997$1$4
Quoted case$996$1.50$5.50
Adverse$993$2$9

The range is $4 to $9 for these scenarios. It does not mean the realized result has a known likelihood of falling inside that range.

Respect transaction constraints

If the adverse output would violate the submitted minimum, the modeled outcome is not a completed swap at that output. It may instead be a revert with paid computation. Minimum-output and maximum-input guards define which executions are acceptable.

Also avoid combining incompatible extremes. For example, the best quoted output may require a route whose workload cannot also achieve the cheapest route's gas estimate. Scenarios should describe coherent transactions.

Use ranges to assess robustness

If two routes differ by $0.10 in the central case while each has several dollars of unresolved cost variation, report the small estimated advantage as fragile. If one route remains preferable across your stated cases, say that it is robust to those assumptions, not to every possible market event.

Record which variables you changed and why. Unsupported numerical bounds should remain illustrative rather than being presented as measured execution-risk limits.

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.

  1. Understanding Swaps on Uniswap

    Exact-input minimum output, exact-output maximum input, quote-size price impact and swap execution distinctions.

    https://developers.uniswap.org/docs/get-started/concepts/traders/swaps

Continue reading

Does waiting for cheaper gas actually reduce total swap cost? When fixed transaction costs dominate a small swap How much better must a quote be to justify extra gas?