What to Do About ETH Transaction Failures and Why They Occur
You are still charged when a transaction on the Ethereum network fails. When a smart contract rejects a transaction or when there isn’t enough gas to cover the cost of the transaction, the transaction fails.
Because miners must confirm transactions to the chain whether they are successful or unsuccessfully, you are still paid for failed transactions. Therefore, whether or not your transaction completes, you are paying for that.
Slippage and not adding enough gas are the two primary causes of failed transactions
If a basic permission or transaction failed, there is likely a gas problem. It’s likely a slippage issue if your transaction on UniSwap or another DEX failed during a trade.
If you are experiencing failed transactions, you either need to raise slippage if you are trading on a DEX or you need to add extra gas by customizing gas before you begin the transaction.
I advise utilizing “quick gas” or custom gas if using MetaMask, and a slippage of at least 3% (but as much as 15% for illiquid pairings) (or the equivalent if not; check current gas prices to see how much gas is needed right now).
Not paying enough gas: In most cases, it’s simple to prevent transactions from failing because you didn’t pay enough for them. By making sure you pay for enough petrol up front, you may prevent this. For instance, in MetaMask, sticking with “normal” or “fast” will usually be sufficient to take gas price changes into consideration. However, you may also enter a specific gas quantity and view the most recent gas prices. This is essentially all you need to know for a single transaction or a batch of straightforward transactions, such as when you open a Maker Vault. Rarely, if ever, will a simple transaction fail; instead, the worst-case scenario is that occasionally, a transaction will be slow but you can speed it up by adding more gas. Solution: To speed up the process, try paying for more petrol up front or adding more gas to the current transaction.
Rejecting a transaction on a DEX: “AMM” DEX exchanges like Uniswap or 1Inch are more likely to reject transactions. The contract rejects the transaction even when you are carrying out numerous transactions at once. The exchange denied your transaction because there was insufficient liquidity to fill you at the advertised price, which can occasionally be a gas issue. Solution: Increase the slippage tolerance.
Conclusion
Alternatively, if your transaction is unsuccessful:
- Either you have a gas issue.
- You may be experiencing slippage.
The slippage tolerance, not the gas, needs to be adjusted if you are on Uniswap or another DEX. You most likely need to alter gas if you are making one transaction.
You should think about adjusting both gas and slippage if you have the ability to do so, particularly if prices and gas costs are out of control.
Transactions that fail will cost money since they are more likely to fail during volatile times.
Therefore, if a transaction fails, go more slowly, update prices, correct slippage, and/or adjust gas, and try again.