When a swap fails
- Author
- CRYPTO PORT Editorial
- Published
- Updated
- Reading time
- 5 min
In short
Swaps usually fail for one of three reasons: the price moved beyond your slippage tolerance, the token approval was not completed, or you do not hold enough of the network's native asset to pay the fee. Open the failed transaction on an explorer, see which kind of error it is, then work through them in order. A failed swap still consumes the fee in most cases, and that is not refunded.
Key points
- A failure still burns the network fee, so repeated retries compound the loss
- Too tight a slippage tolerance will not go through on a volatile pair
- Fees are paid in the network's native asset; a zero balance guarantees failure
- Widening the tolerance too far raises the risk of executing at a bad rate
Definition
A swap submitted on a decentralised exchange that settles as a failed transaction, so no exchange takes place — while the network fee spent on the attempt is still consumed.
Start by identifying the cause. Take the failed transaction's ID from your wallet history and open it on a block explorer. Failed transactions usually record a reason, which tells you roughly whether it was slippage, an insufficient balance or a missing approval. Changing settings and retrying without reading that is how people lose the fee several times over.
Next, check your balance of the fee asset. Even when you are swapping tokens, the fee is paid in the network's native asset. Plenty of the token you want to trade does not help if your fee balance is zero. It is a surprisingly common cause, so rule it out early.
Then look at slippage. Swap screens generally have a setting for how much price movement you will tolerate between submitting and executing. Set it too tight and a tiny move in that interval causes a failure — more likely on thinly traded pairs and in volatile periods. But widening it is not simply the answer: the wider it is, the more room there is to execute at a materially worse rate than you expected. 'How to avoid slippage' covers the trade-off.
Some swaps also need a separate token approval. In most designs, the first time you use a token you must authorise the swap contract to spend it, and that authorisation is its own transaction — if it failed, the swap cannot go through. Pay attention to the scope of what you approve, and do not leave unnecessarily broad permissions in place; 'When an approval is still active' deals with that.
If several adjustments still will not get it through, stop. Extremely thin liquidity, or a token deliberately built with restrictions on selling, can make a swap impossible by design. Investigating what the token actually is comes before spending more on fees.
Watch out for
- · Retrying blindly only stacks up fees. Identify the cause before you try again
- · Do not accept help from anyone who wants to connect to your wallet to 'configure the swap for you' — that is how control is handed over
- · Do not set an extreme slippage tolerance; it invites execution at a poor rate and makes you a target for traders exploiting the gap
Frequently asked questions
It failed but I was still charged. Do I get that back?
No. The fee pays for the network attempting the work, so it is consumed whether the result is success or failure. That is precisely why diagnosing before retrying saves money.