0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

How to Set a Minimum Output for a Cross-Chain Swap

0
Posted at

For a quote of 0.50 ETH, a 1% slippage tolerance sets the minimum output at 0.495 ETH. Use the amount you will receive on the destination chain, then set a floor that reflects the worst price change you can accept before the swap should fail or be stopped.

Set the floor from the final amount you expect

The minimum output is the least amount of the destination asset you agree to receive for a given input. It is usually calculated from the quoted output, not from the input’s dollar value: minimum output = quoted output × (1 − tolerance).

For example, if you send 0.10 BTC and the route quotes 1.50 ETH, a 1% tolerance gives a floor of 1.485 ETH. If the route can only deliver less than that when it executes, the floor is meant to prevent the swap from completing at the worse amount. Check that the quote and floor are both denominated in the same destination asset.

Ethereum.org’s DEX design guidance treats “minimum received” as the output-side expression of slippage tolerance. The distinction that matters for a cross-chain route is to calculate against the final destination amount: the quote may include more than one conversion before the asset reaches your wallet.

Separate price movement from fees and price impact

A tolerance is not a way to estimate the route’s total cost. The quote may already reflect pool fees, network costs, and the price impact of your trade; the tolerance sets how far the eventual output may fall below that quote. Price impact is the effect your trade size has on the quoted rate, while slippage is the change between quote and execution.

For example, if a quote is already 3% below an external reference price because the route has thin liquidity or a large trade size, setting a 1% tolerance does not correct that poor quote. It only limits how much worse execution can be than the quote. Reduce the amount or reconsider the route if the quoted price impact is unacceptable.

That distinction matters when reading about how thor swap handles cross-chain execution: route execution explains how a trade can move between chains, while choosing a minimum output is your decision about the least destination amount you will accept. A thor swap flow is useful when you want a service to move and swap assets across chains in one flow; the same output check still applies.

Choose a tolerance that matches the route

There is no universally safe percentage. A tighter tolerance protects the quoted price but can cause a swap to fail or return funds if prices move before execution; a wider tolerance makes completion more likely while allowing a lower output. For a liquid route in calm conditions, around 0.5–1% can be a starting example, not a guaranteed recommendation. Volatile assets, thin pools, and delayed confirmations can need a wider range.

Use the quote’s own minimum-output control if it provides one, and verify the displayed minimum in the destination asset before approving. If the interface accepts a percentage, calculate the implied floor yourself. If it accepts an absolute amount, use the formula above. When the quoted output changes materially while you are reviewing it, recalculate rather than relying on the earlier number.

Cross-chain execution adds time for the source transaction to confirm and for the destination transfer to complete. A quote can therefore become stale while the transaction is in flight. The route may also pass through multiple liquidity pools; THORChain’s Swappers reference describes a BTC-to-ETH example that uses BTC/RUNE and RUNE/ETH pools. Each leg can affect the final output, so assess the final amount rather than judging one leg’s rate in isolation.

When using thor swap, compare the quoted destination amount with the minimum you would actually accept, then decide whether the tolerance is appropriate for that trade’s size and volatility. If it is not, change the trade size or wait for a better quote before proceeding. A minimum-output setting cannot guarantee a market price; it defines a boundary on execution.

Questions to check before you confirm

Does the minimum include network fees?

It depends on how the service presents its quote. Compare the minimum with the final amount expected in the destination wallet, after any costs deducted from the output. Source-chain transaction costs may be paid separately, so they will not necessarily appear in that output figure. Treat the quoted minimum as an output floor, not a complete accounting of every cost.

What happens if the swap cannot meet the floor?

That depends on the route’s rules. Some execution systems reject or stop a trade that misses its minimum; cross-chain systems may instead return funds after a failed or expired execution, which can involve time and network costs. Check what the service says happens on failure before sending funds, especially if a delay would matter for your task.

Should I widen the tolerance if the swap fails?

Only if you are willing to accept a lower destination amount. First refresh the quote and check whether the price, route, or market conditions changed. A wider tolerance can help a trade execute, but it may also permit a materially worse output. If the refreshed quote itself is unattractive, reduce the trade size or wait rather than loosening the floor automatically.

  • Calculate the floor from the quoted destination output.
  • Judge price impact separately from tolerance.
  • Check the final amount, route delay, and failure behavior before confirming.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?