DEV Community

Jack Ridersor
Jack Ridersor

Posted on

Thor Swap: Set a Minimum Output Without Guesswork

Set the floor just below the quoted receive amount. For a cross-chain swap, that floor is the least destination asset you agree to accept after price movement and route costs; it turns a quote into an execution limit, so you can protect value without rejecting every small price change.

The minimum output is your acceptance floor

Minimum output, sometimes shown as “min received,” is the smallest amount of the destination asset the swap may deliver and still count as successful. The quote’s expected output is an estimate; the minimum is your protection if prices move between quoting and execution.

When comparing a thor swap route, check both figures and the tolerance behind the floor. Use a thor swap aggregator to compare expected output across routes, then judge the minimum against the amount you actually need to receive. A route with a slightly higher quote can be worse if its floor is much lower.

Set the floor from the quote and your tolerance

Calculate the floor by multiplying expected output by one minus your slippage tolerance. If a quote expects 0.32 ETH and you choose 1% tolerance, the floor is 0.3168 ETH. That percentage is an example, not a universal setting: tighter tolerance rejects more price movement, while wider tolerance accepts more.

Use the expected output shown for the route you intend to execute, after its quoted route costs. Don’t subtract the same fees again unless the interface explicitly says they are excluded. Network gas is often paid separately in the source-chain asset, so check that balance too; it is a transaction cost, not destination output.

Choose tolerance for the asset and route

Set tolerance according to how much the market and route can move before execution, not according to a habit. A liquid asset pair may need less room than a thinly traded pair, and a multi-step route can be exposed to changes at more than one swap.

For a routine trade, I’d start with a tight setting and widen it only if the route repeatedly fails from price movement. A setting such as 0.5% or 1% can illustrate a starting point, but the right value depends on the pair, trade size, and how quickly the quote becomes stale. If raising tolerance makes the minimum unacceptable, wait for a better quote or choose another route.

Know what happens when the floor is missed

If execution would deliver less than your minimum, the swap should fail or stop rather than complete below your limit, but the exact handling depends on the route. In cross-chain trades, the source transaction may already have been submitted before the destination step is attempted, so a missed floor can leave the trade pending or trigger route-specific recovery.

For example, if you send 1,000 USDC toward a quoted 0.32 ETH and the destination step can only deliver 0.315 ETH against a 0.3168 ETH floor, don’t submit the same trade again immediately. Check its status first. Retrying before you know whether the original route completed or is recovering can create a second trade and another gas charge.

Check these details before submitting

Before you confirm a thor swap, make sure the quote and floor still match your intent:

  • The destination asset and receiving address are correct.
  • The expected output and minimum output are both visible.
  • The tolerance is acceptable for this pair and trade size.
  • You have enough source-chain gas for the transaction.
  • You know where to check status if the destination step stalls.

A useful minimum output is the lowest amount you can accept, not an arbitrary percentage. Compare the route’s expected output, set a floor that protects your trade, and check the transaction status before retrying if execution does not finish.

Top comments (0)