When a blockchain gets congested, transactions can fail or execute at worse prices than expected. This guide explains how to minimize slippage and avoid failed transactions by setting proper gas limits, using slippage tolerances wisely, and timing your transactions during less busy periods.
What You’ll Need
- A Web3 wallet (e.g., MetaMask, WalletConnect-enabled wallet)
- Access to a decentralized exchange (DEX) or dApp where you trade or interact
- Basic understanding of gas fees and transaction confirmations
- Optional: a block explorer (like Etherscan) to monitor network congestion
Step-by-Step
- Check current network congestion. Before any transaction, look at the average gas price or a congestion indicator (e.g., mempool size). If the network is heavily congested, consider waiting for a quieter period (often weekends or off-peak hours).
- Set a realistic slippage tolerance. Slippage is the maximum price change you’re willing to accept between order submission and execution. For volatile tokens or low-liquidity pairs, start with 1–2% (most DEXs default to 0.5–1%). Increase only if your trade keeps failing.
- Use the “Auto” or “Advanced” gas settings in your wallet. Wallets often offer “Low,” “Medium,” or “High” options. On a busy network, choose “High” or manually set a gas price slightly above the current average to get your transaction picked up faster.
- Set a higher gas limit for complex transactions. Gas limit is the maximum amount of gas you’re willing to spend. For simple token swaps, 200,000–300,000 is typical. For interactions with smart contracts (e.g., staking, minting), use the wallet’s suggested limit or add 20–30% buffer to avoid out-of-gas errors.
- If a transaction fails, do not immediately retry with the same settings. First, check the error message (e.g., “execution reverted,” “insufficient funds for gas”). Adjust the gas price upward or increase slippage slightly, then resubmit.
- Use a DEX aggregator. Aggregators like 1inch or Paraswap split your trade across multiple liquidity pools to reduce price impact and slippage. They also often have smart routing that can help avoid failed transactions.
- Consider using a limit order. Some DEXs (e.g., dYdX, 1inch limit orders) allow you to set a specific price. The order only executes when the market reaches that price, eliminating slippage entirely.
- Monitor your pending transaction. If a transaction is stuck for a long time, you can “speed up” (increase gas) or “cancel” it from your wallet. Cancelling also requires a gas fee, but it frees up your nonce.
Common Mistakes
- Setting slippage too low. On a volatile market, a 0.1% slippage tolerance may cause your transaction to fail repeatedly because the price moves faster than your order.
- Ignoring gas price spikes. If gas prices are rising rapidly, your transaction might be underpriced and stuck for hours.
- Using a gas limit that’s too low. For token swaps that involve multiple steps (e.g., ETH → USDC → DAI), the required gas can be higher than a simple swap. Always use the wallet’s estimate.
- Retrying the same transaction without adjusting. If it failed once, the same settings will likely fail again.
- Not checking token approvals. If you haven’t approved a token for spending, the transaction will fail. Approve first, then swap.
Tips
- Trade during off-peak hours. For Ethereum, weekends and late nights (UTC) often have lower gas fees.
- Use Layer-2 networks. If you’re on Ethereum, consider using Arbitrum or Optimism for cheaper and faster transactions, which also reduces slippage risk due to faster block times.
- Keep a small buffer in your wallet for gas. If you’re swapping all your ETH for another token, you’ll have nothing left for gas. Keep at least 0.01 ETH (or equivalent) for fees.
- Use the “max” button carefully. The “max” button often leaves a tiny amount of the base token (like ETH) for gas, but if the gas price spikes, you might still run out.
- Check the liquidity of the pair. Low-liquidity pairs have higher price impact. If the pool is tiny, even a small trade can cause significant slippage.
Troubleshooting
Transaction keeps failing with “execution reverted.” This usually means the smart contract rejected your trade. Possible reasons: slippage too low, insufficient balance, or the token has transfer restrictions. Increase slippage to 2–3%, verify your balance, and check if the token is on a blocklist.
Transaction is stuck as “pending” for hours. The gas price you set is too low for current network conditions. Use the “speed up” feature in your wallet to resubmit with a higher gas price. If you don’t want to wait, you can cancel the transaction (also costs a fee).
“Insufficient funds for gas” error. Your wallet doesn’t have enough of the native token (ETH, BNB, MATIC) to cover the gas fee. Add more native token to your wallet, or reduce the amount you’re swapping.
“Intrinsic gas too low” error. The gas limit you set is below the minimum required. Increase the gas limit to the wallet’s suggested value.
Transaction succeeds but you got far less than expected. This means slippage was higher than you set (or you set it too high). For large trades, consider breaking them into smaller chunks to reduce price impact.
Frequently Asked Questions
Q: What is slippage exactly?
A: Slippage is the difference between the price you expect and the price you actually get when the trade executes. It happens because the price changes between when you submit the order and when it’s mined.
Q: How do I know what slippage to set?
A: For stablecoin pairs, 0.1–0.5% is fine. For volatile tokens or low-liquidity pairs, use 1–2%. If your trades keep failing, increase it gradually.
Q: Why did my transaction fail even though I set 1% slippage?
A: The price moved more than 1% between submission and execution. This can happen on volatile days. Try increasing slippage or waiting for calmer market conditions.
Q: Can I avoid slippage entirely?
A: Yes, by using limit orders. You set the price you’re willing to pay, and the order only executes if the market reaches that price. No slippage, but you might miss the trade if the price never hits your limit.
Q: Does using a higher gas price guarantee success?
A: Not always, but it increases the chance your transaction gets included in the next block. If the smart contract itself rejects the trade (e.g., due to slippage), no gas price will fix that.
Q: What’s the difference between gas price and gas limit?
A: Gas price is the amount you pay per unit of gas (in gwei). Gas limit is the maximum units of gas you’re willing to use. The total fee is gas price × gas used. If you set a low gas limit, you might run out of gas mid-transaction, causing failure.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Cedro di Taormina vs Cedro Virtuoso: How to Choose
- Measles Exposure: What to Do Next
- Nvidia Share Not Responding: Fixes That Work
- AI Strategy: Linking Goals to Measurable Outcomes
- Tune Retraction & Flow for Any Nozzle & Filament
- Recover Deleted Photos From SD Card: Full Guide