DEV Community

Bridgette Wisoky
Bridgette Wisoky

Posted on

How Do I Check a Cross-Chain Swap Before Sending?

Check the source asset and network, the destination asset and network, and the addresses that will receive or return funds before you send. Then compare the estimated output with your minimum acceptable amount and keep enough of the source coin to pay the wallet’s network fee. This catches the mistakes that are hardest to undo.

A cross-chain swap has a source path and a destination path

Before a swap, you need to know what leaves your wallet and where the result will arrive. For example, if you want to move from Bitcoin to ETH on Arbitrum, the source is BTC on Bitcoin and the destination is ETH on Arbitrum. An address can look valid yet belong to the wrong asset or network.

There are also two addresses to check: the destination address for the swapped asset, and a refund address for the source asset if the swap cannot complete under its conditions. They may need different formats because they are on different chains. In Chainflip’s deposit flow, the swap details are registered first; after the source deposit is confirmed, the protocol processes the swap and broadcasts the output to the chosen destination address.

Verify the details before you send

Use this routine before confirming the source transaction. Treat the quote as an estimate with conditions, not a promise of a fixed payout.

  1. Match the source. Confirm the asset and network in your wallet match the swap’s source. Sending ETH on Arbitrum is not the same as sending ETH on Ethereum mainnet.
  2. Check both addresses. Copy the destination from the wallet intended to receive the output, then verify its network and first and last characters. Set a refund address you control that can receive the original asset on its source chain.
  3. Read the output and protection. Check the estimated amount after applicable swap and payout costs. Note any minimum output or slippage protection: this sets the least favourable price the swap will accept, and a swap outside that condition may be refunded instead.
  4. Keep source-chain gas. Leave enough of the network’s fee-paying coin in the sending wallet for the deposit transaction. For example, an ERC-20 transfer on Ethereum generally needs ETH for gas, even when the asset being swapped is USDC.
  5. Send only to the current deposit address. If the swap uses a one-time deposit address, use the one created for this swap and send within its validity period. Chainflip documents that its deposit channels expire after 24 hours, so do not reuse an old address.

After sending, save the transaction ID and wait for the source-chain confirmation and the destination payout. For instance, Bitcoin may take longer to confirm than an EVM-chain deposit. Don’t send a second deposit just because the first is still pending; check its status using the transaction ID.

Make the checks before committing funds

Wallet swaps put network selection and address control in your hands, so verify both before signing. The final check is simple: correct source, correct destination, working refund address, acceptable minimum output, and enough gas. For the cross-chain case, Chainflip native asset swaps is a concrete example of exchanging native assets between networks; the same checks help you prepare to swap from your own wallet.

Why can the amount received differ from the estimate?

The estimate is based on a quote and current pool conditions. The final amount can also reflect swap fees and the cost of broadcasting the destination transaction, which may vary with network conditions. Slippage protection sets a boundary for execution; it does not necessarily include every fee deducted outside the swap itself.

What happens if a swap cannot meet its price condition?

Depending on the protocol’s rules, it may retry during a set window or return the unprocessed source funds to the refund address. A refund is a separate on-chain transaction and can incur network costs. Check that the refund address is yours and compatible with the source asset before sending.

Can I reuse a deposit address for my next swap?

Don’t assume you can. Some protocols create a deposit address tied to one registered swap, and it may expire or later be assigned differently. Open a fresh swap and use its current deposit details each time; this keeps the deposit connected to the intended destination and refund instructions.

Top comments (0)