How to Cancel a Stuck Swap Transaction on Ethereum
A stuck Ethereum swap transaction cannot be cancelled in the usual sense - you cannot delete it from the network. Instead, you must send a new transaction that overrides the stuck one, either by replacing it with a higher gas fee or by sending a null transaction that makes the original invalid. This process works because Ethereum processes transactions from the same wallet in nonce order, and you control your own nonce sequence.
Why transactions get stuck
Every transaction from your wallet has a sequential nonce number. Miners process transactions in nonce order for each address. If you submit a swap with a low gas price, it may sit in the mempool (the queue of pending transactions) for hours or days, never getting confirmed. Meanwhile, any new transaction you send with a higher nonce will remain pending behind the stuck one because the network will not confirm a higher nonce before a lower one from the same wallet.
Common causes of stuck transactions: - Gas price set too low for current network congestion. - The swap involves complex routing through multiple pools, requiring more gas than your limit allowed. - A price impact or slippage check caused the swap to revert, but the transaction remains in the mempool.
Method 1: Speed Up the Transaction (Replace with Higher Gas)
Most wallets offer a "speed up" option. This sends a new transaction with the same nonce but a higher gas price. Since miners prioritize higher gas prices, the new transaction replaces the original in the mempool.
- Open your wallet's activity or pending transactions list.
- Find the stuck swap transaction. Look for a "speed up" or "replace" button.
- If you see one, click it. The wallet will automatically increase the gas price - often by 10-20% or to a suggested "fast" level.
- Confirm the new transaction. It will use the same nonce as the stuck one.
- Wait for confirmation. Once confirmed, the original transaction is replaced and cannot execute.
If your wallet does not have a speed-up button, you must manually send a replacement transaction with a higher gas price and the same nonce.
Method 2: Cancel the Transaction (Send a Null Transaction)
You can "cancel" a pending transaction by sending a new transaction to yourself (or to a burn address) with zero value, higher gas, and the same nonce. This overrides the stuck swap because the network only processes one transaction per nonce.
- Open your wallet and navigate to "send" or "transfer." Do not use the swap interface.
- Set the recipient to your own wallet address. A zero-value transfer to yourself is simplest.
- Set the amount to 0 ETH (or 0 of any token). Do not send real tokens.
- Before confirming, manually adjust the nonce to match the stuck transaction's nonce. Most wallets require enabling "advanced" or "custom" nonce settings to do this.
- Set a gas price higher than the stuck transaction's gas price. Check a gas tracker site for current "fast" or "average" prices.
- Confirm and sign the transaction. Wait for it to confirm.
- Once confirmed, the stuck swap is effectively cancelled. You can now send a new swap transaction.
Important: If you do not set the nonce correctly, you will send a new transaction with a different nonce, leaving the stuck one untouched.
Method 3: Wait for the Mempool to Drop the Transaction
Transactions can remain in the mempool indefinitely, but most nodes drop transactions after a few hours if they are not confirmed. Some nodes may hold them longer. This is unreliable - especially during high congestion periods - and should be considered a last resort. If you wait and the transaction eventually drops, you can then send a new swap with appropriate gas.
What Happens to Your Tokens During a Stuck Swap
Your tokens remain in your wallet until the swap transaction actually executes. A stuck transaction does not lock your funds. However, you cannot send a transaction with a higher nonce until the stuck nonce is processed or overridden. This means you cannot swap or transfer ETH or tokens from that wallet until you resolve the stuck transaction.
Preventing Stuck Swaps
- Check current gas prices before sending. Use a gas tracker site to set a gas price in the "fast" or "standard" range for your desired confirmation speed.
- Set your gas limit generously. Complex swaps (e.g., through aggregators or multiple pools) may require more gas than a simple transfer. Most wallets estimate this, but during high volatility, manual increases are safer.
- Use a wallet that supports EIP-1559 (Ethereum Improvement Proposal 1559) fee estimation. This dynamic fee mechanism adjusts base fees automatically, reducing the chance of underpricing.
- Consider using a DEX aggregator that optimizes gas for you.
When to use each method
- Speed up: Use when your wallet supports it and you want the swap to go through at a higher cost.
- Cancel with null transaction: Use when you no longer want the swap to execute, or when speed up fails.
- Wait: Use only as a last resort, and be prepared for delays of hours or longer.
A stuck swap is not a loss of funds. It is a temporary inability to use your wallet for new transactions until you resolve the nonce issue. Acting quickly with a manual override is almost always faster than waiting.
Not financial advice. milkshakeswap.finance publishes market data and general information about MilkshakeSwap Token. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.