Fees & trade costs

Estimate the cost of swapping out and immediately back

Budget an out-and-back token conversion while distinguishing independent snapshot quotes from a sequential change to the same pool.

A round-trip budget starts with the amount you spend, estimates the amount you can recover by selling what you actually acquire, and includes every separate payment for both directions. Do not reuse the original input quantity as the reverse trade's size unless it matches the tokens acquired.

A sequential hypothetical budget

Suppose 1,000 stablecoins buy 95 tokens. A reverse quote for those 95 tokens, under your stated post-purchase scenario, returns 985 stablecoins. Each swap has $0.50 of separate network cost, and the first direction requires a $0.30 approval.

The round-trip shortfall is 1,000 − 985 + 0.50 + 0.50 + 0.30 = $16.30, assuming one stablecoin equals one dollar for this example. It is 1.63% of the initial 1,000-unit trade budget.

Why two screenshots can mislead

If the reverse quote was obtained before the purchase and assumes the old reserves, it does not model the post-purchase pool. Uniswap v2 pricing depends on reserve state. A trade against the same pool changes the starting point for a later trade.

Conversely, assuming that all initial price impact is permanently lost can also misstate a simplified same-pool round trip. Selling back changes the pool in the opposite direction. Use the actual sequence or an explicit model rather than adding two unrelated impact percentages.

State what has been excluded

The hypothetical budget above excludes outside market movement, liquidity changes, token transfer charges and failed attempts. It does not predict a future exit price.

For an already completed round trip, use balance changes and receipts from both sides. For a proposed round trip, label the reverse state assumption and retain an uncertainty range. A round-trip calculation is a cost diagnostic; it is not evidence of an arbitrage opportunity or a forecast that the token price will remain stable.

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. Uniswap v2 Pricing

    Reserve-driven pricing, external reference price, exact input and output distinctions.

    https://developers.uniswap.org/docs/protocols/v2/concepts/pricing

Continue reading

Include the cost of leaving a position in a trade budget Why two pool fees do not always add to a single percentage Measure a buy-sell spread from executable quotes