HomeCryptoTroubleshooting › Transaction failed but the gas was still taken

Transaction failed but the gas was still taken

The transaction reverted, you got nothing, and the fee left your wallet anyway.

What is actually happening

Gas pays validators for the computation they performed. They performed it, the contract rejected the result, and the work still happened. This is how the network is designed rather than a fault.

How to fix it

  1. Open the transaction on the block explorer and read the revert reason. It usually names the actual problem.
  2. For a swap, the usual cause is slippage: the price moved past your tolerance while the transaction was in flight. Raise slippage slightly and retry.
  3. For a token with a transfer tax, slippage must exceed the tax or every swap reverts.
  4. For an NFT mint, the supply probably sold out while your transaction was queued.
Raising slippage costs you money on every trade and invites sandwich attacks. Raise it in small steps, not to twenty percent because a guide on the internet said so.
RELATED
RISK WARNING Crypto assets are highly volatile and largely unregulated. You can lose everything you put in. Nothing on this page is financial, investment or tax advice, and nothing here is a recommendation to buy or sell any asset. Do your own research and never commit money you cannot afford to lose.
← PREVIOUS
Transaction stuck pending
NEXT →
Token is not showing in my wallet