DEV Community

Gogu
Gogu

Posted on

How to Estimate Your Cross-Chain Swap Output

If you move crypto across chains a few times a year, estimate what will arrive by checking the final destination-asset quote and the costs along the route. The destination chain is the network where your funds will land. A service such as relay bridge can route a transfer and swap in one flow, but you still need to judge the amount shown at the end.

Which amount should you compare?

Compare the amount you expect to receive on the destination chain with the amount you need there. A quote is the service’s estimate of that amount for your chosen input and route. A swap route is the path the trade takes, which may use one or more exchanges or a liquidity provider—a source of tokens available for trading.

Check that the quote names the right token and destination chain. For example, USDC on Arbitrum is USDC on a particular network; it may not be usable where USDC on another network is required.

How do you estimate the net amount?

Work through these steps before you confirm. Use the actual quote for your chosen amount, because rates and costs can change with the route and network conditions.

  1. Write down your input and the displayed exchange rate. For example, say you send 0.1 ETH and the route estimates 2,000 USDC per ETH. The gross value is 0.1 × 2,000, or 200 USDC.
  2. List the costs included in the quote. A trading fee pays for the swap; network gas pays for blockchain transactions. The route may also include a bridge or liquidity cost. Check whether each cost is already reflected in the receive amount, so you do not subtract it twice.
  3. Allow for price impact and slippage. Price impact is the rate change caused by your trade size. Slippage is the difference between the quoted and completed rate. If the route shows 0.2% trading cost and you estimate another 0.3% for price movement, that is about 1 USDC on 200 USDC. Subtract any separately listed costs too.
  4. Compare the net estimate with your need. If the quote already shows 197 USDC after all listed costs, compare 197 with your target; do not subtract those costs again. A relay bridge route can combine the transfer and swap, so judge the final amount rather than counting steps.

For a rough check, subtract each cost once from the gross amount. In the example, 200 USDC minus about 1 USDC in swap and price costs leaves about 199 USDC, before any separate costs not already included. The displayed net quote is the better estimate when it clearly accounts for them.

What could change before delivery?

A quote can move before the transaction completes, especially if the market shifts or the route has limited liquidity. If the final rate falls below your slippage setting, the swap may fail instead of delivering less than that limit; check the setting before confirming.

For a transfer you only make occasionally, pause if the destination token, network, or net amount differs from what you intended. Recheck the quote just before confirming, since a stale estimate may no longer describe the route.

Top comments (0)