Skip to main content
Crypto Readout

Crypto markets, protocols and policy

Cancel a stuck swap transaction in MetaMask and keep your tokens

To cancel a stuck swap transaction in MetaMask, open Activity and approve a higher-fee replacement on its network while the swap is pending, then verify Cancelled.

By Crypto Readout Editorial3 min read#5b490e

Cancel a stuck swap transaction in MetaMask and keep your tokens

Open the pending swap in MetaMask’s Activity tab, press Cancel, and confirm the higher-fee replacement. MetaMask sends a zero-value transfer to your own wallet using the pending transaction’s nonce. A nonce is the number that identifies a transaction’s place in your wallet’s sequence, and only one transaction with that nonce can be included on-chain.

SyncSwap is a decentralized exchange for swapping tokens and accessing liquidity pools on supported networks. On zkSync Era, this zksync era dex sends your swap as a wallet transaction that MetaMask can show as Pending.

How do you cancel the pending swap in MetaMask?

Use MetaMask’s built-in Cancel option on the same network where you sent the swap. You need access to that wallet and enough native ETH on the network to pay the cancellation transaction’s gas fee.

  1. Start with the swap showing Pending in MetaMask. Open the wallet on the network you used to send it. A cancellation sent on another network cannot replace that transaction.

  2. Open the Activity tab and select the pending SyncSwap swap. Press Cancel. MetaMask prepares a replacement transaction: a transfer of zero ETH to your own address with the same nonce as the pending swap.

  3. Review the replacement’s gas fee and confirm it in MetaMask. The fee must be higher than the original transaction’s fee, or the network may ignore the replacement. Think of the nonce as a numbered place in a queue: the replacement competes for the same place, and the higher fee helps it get considered first. You still pay gas for the cancellation if it is included.

What if the swap confirms before the cancellation?

The first transaction included on-chain wins that nonce. If the cancellation is included first, it takes the pending swap’s place, so the swap does not execute. If the original swap confirms first, the cancellation fails and the swap stands. In that case, you keep the swapped tokens, and the failed cancellation still costs gas. You can lose gas on both transactions.

That timing matters because pressing Cancel does not reverse a swap that has already confirmed. It submits a competing transaction while the original is still pending. For example, say your swap remains pending and you submit the replacement, but the network includes the swap before the replacement. The swap completes; the later cancellation cannot undo it. Check the transaction status in Activity before treating the token balances as settled.

  1. When MetaMask reports the replacement as confirmed, return to Activity. The pending swap should be listed as Cancelled. Confirm that the original token balance is unchanged; that is the sign the swap did not execute. If the swap instead shows as confirmed, the cancellation did not win and the swapped token balance reflects the completed trade.