Fix a swap problem

Swap failed but gas was charged: what happened?

Find out why a reverted swap still costs gas, how to verify the receipt, what happens to your input tokens and what to check before retrying.

A swap that reaches the blockchain can fail and still consume gas. You pay for the execution work performed before the failure; a successful token exchange is not a condition of that payment. First confirm that the charge belongs to a mined, failed swap. A successful approval followed by an unsubmitted swap is a different situation.

Establish what actually failed

Open the transaction hash on the explorer for the network you used. Check the sender, block number, transaction status and fee. For an EVM receipt, status: 0 identifies a failed top-level execution; status: 1 identifies a successful one. The receipt-status specification also explains why using all the gas is not a reliable test of failure.

If the hash is only pending, there is no final execution result yet. If your wallet never produced a hash, do not assume its error proves that a paid onchain failure occurred. Check the account’s recent transactions before submitting another swap.

Read the transaction action as well. Uniswap’s missing-token guidance specifically distinguishes an approval from a swap. An approval can confirm and cost gas even though you have not exchanged anything.

What happens to the input tokens?

For an ordinary same-chain swap whose entire transaction reverts, the token transfers and contract state changes inside that failed execution roll back. The network fee does not. The REVERT specification describes this rollback and allows execution to return an error reason without necessarily consuming every remaining gas unit.

A separately confirmed approval remains a separate transaction. Its success is not undone by a later swap failure. Likewise, a cross-chain operation can involve multiple transactions; a failure on one leg does not establish that every earlier leg rolled back. This article’s rollback explanation applies to the failed same-chain transaction itself.

Check the actual charge, not the maximum estimate

On Ethereum, the execution fee is gas used multiplied by the effective price per gas. Your wallet’s maximum fee estimate can be higher than the final charge. Ethereum’s gas documentation distinguishes the execution budget from the price paid for each unit.

Hypothetical example: a transaction uses 120,000 gas at an effective price of 2 gwei. Its execution fee is 240,000 gwei, or 0.00024 ETH. This is arithmetic, not a current fee estimate. Other networks can have different fee components, so use the explorer’s final fee breakdown for your actual chain.

Find a reason before paying for another attempt

EvidenceUseful next step
Minimum output or slippage check failedRequest a fresh quote and examine the amount you would receive. Raising tolerance permits worse execution; it does not repair liquidity.
Transaction deadline expiredCreate a fresh quote and transaction. Reusing expired transaction data preserves the failure condition.
Out of gasReview the execution gas limit and the application’s current estimate. A higher gas price alone does not increase the execution budget.
Token transfer restriction or incompatible token behaviorCheck the token and route documentation. Repeatedly adding gas or widening slippage may change nothing.

Uniswap documents several of these failure conditions, including slippage, deadlines and token incompatibilities. A generic “execution reverted” label is not enough to choose a remedy. If the reason remains unclear, retain the hash, chain, token contracts and application error for official support.

Can the gas fee be refunded?

The wallet cannot reverse a confirmed network charge. MetaMask explains that it does not receive this gas payment and cannot refund it. Any separate service reimbursement would depend on that service’s stated policy; it is not a reversal of the blockchain fee.

Before retrying, identify both the failure condition and the change that addresses it. A fresh quote, corrected allowance or supported route can be relevant changes. Pressing the same button with the same unresolved condition can simply produce another paid failure.

Sources & verification (6)

Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.

  1. Gas and fees

    Gas measures execution work; actual fees, out-of-gas behavior and fee components.

    https://ethereum.org/developers/docs/gas/
  2. EIP-140: REVERT instruction

    Execution rollback, unused gas and revert reason behavior.

    https://eips.ethereum.org/EIPS/eip-140
  3. EIP-658: Embedding transaction status code in receipts

    Receipt status indicates success or failure of the top-level call.

    https://eips.ethereum.org/EIPS/eip-658
  4. Why did I pay gas fees for a failed transaction?

    A failed included transaction consumes gas; MetaMask cannot refund a network fee it did not receive.

    https://support.metamask.io/more-web3/learn/why-did-i-pay-gas-fees-for-a-failed-transaction
  5. Why did my transaction fail?

    Slippage, deadline, native gas availability, token fee and router compatibility failure conditions.

    https://support.uniswap.org/hc/en-us/articles/8643975058829-Why-did-my-transaction-fail
  6. Why aren’t my tokens showing up in my wallet?

    Approval versus swap, hidden tokens and selected network checks.

    https://support.uniswap.org/hc/en-us/articles/8122264374925-Why-aren-t-my-tokens-showing-up-in-my-wallet

Continue reading

I approved a token but received nothing: did I swap? Swap out of gas: when changing the gas limit helps The swap failed on slippage: what should change before retrying?