Home » Finance » Cryptocurrency » How to Fix “cannot estimate gas” on PancakeSwap

How to Fix “cannot estimate gas” on PancakeSwap

Are you getting a “cannot estimate gas” error on PancakeSwap?

Here’s the second part of the error message, “The transaction cannot succeed due to error: cannot estimate gas”.

Followed by, “transaction may fail or may require manual gas limit. This is probably an issue with one of the tokens you are swapping”.

If so, you won’t be able to buy or sell the token on PancakeSwap.

The error can occur when you’re swapping a token like Bonfire, Safemoon, or others.

Errors like these are very common on PancakeSwap, so you’re not the only one experiencing them.

In this guide, you’ll learn what “cannot estimate gas” means on PancakeSwap and how to fix it.

What does “cannot estimate gas” mean on PancakeSwap?

Cannot estimate gas PancakeSwap

Cannot estimate gas on PancakeSwap means that the exchange cannot evaluate the fee of the transaction.

This typically happens when there are too many decimal places in the number of tokens.

When there are too many decimal places in the number of tokens, the “cannot estimate gas” error will occur.

For example, if you’re swapping BNB for 155.948235 ANKR, you may get the error message.

This is because the token has too many decimal places.

Another reason why you got the “cannot estimate gas” error is that the token might be a scam.

To check whether the token is a scam, you need to view its recent transactions on bscscan.com.

If the token has a lot of recent transactions (both buys and sells), it’s most likely not a scam.

However, if the token has little to no transactions, the token is probably a scam.

How to fix “cannot estimate gas” on PancakeSwap

To fix “cannot estimate gas” on PancakeSwap, you need to increase your slippage tolerance to 12%.

After you’ve increased your slippage tolerance, you need to change the number of tokens you’re trying to swap.

For example, if you’re trying to swap BNB for Safemoon, the number of Safemoon may have a lot of decimal places.

Otherwise, the last numbers of Safemoon might be very randomized (e.g. 5207218).

If that’s the case, PancakeSwap might not be able to estimate the fee of the transaction.

As a result, the transaction will fail and you’ll get the “cannot estimate gas” error.

On the other hand, a low slippage tolerance can cause your transaction to fail due to the fee of the token.

You can fix this by increasing your slippage tolerance in increments to find out the lowest slippage tolerance for the transaction to succeed.

Step 1: Select the tokens and open the settings

  1. Open PancakeSwap and connect your wallet.
  2. Select the token that you want to buy in the “To” field.
  3. Select the token that you want to use to swap for it in the “From” field.
  4. Tap on the Settings icon.

Step 2: Change your slippage tolerance to 12%

  1. Input 12%* into the “Slippage tolerance” field.
  2. Tap on the “X” icon to close the Settings.

*Instead of entering “12%”, you can increase your slippage tolerance in increments.

For example, you can start with a 2% slippage tolerance, then work your way up to 4%, 6%, 8%, and more.

This will allow you to find the lowest slippage tolerance for the transaction to succeed.

However, if you’re trying to buy a token like Safemoon, you’ll need to set a slippage tolerance of 12% (this is due to the token’s fees).

Step 3: Enter the amount of BNB/ETH you want to swap

  1. Select the tokens that you want to swap if you haven’t already (e.g. from BNB to ANKR).
  2. Enter the amount of BNB or Ethereum that you want to swap for the token (e.g. if you want to swap 0.04515 BNB, input “0.04515” in the “From” field*).

*This will make the “To” field estimated.

Do note that the “To” field cannot be estimated if you’re buying a token, it can only work if you’re selling.

If the “To” field is estimated, you may receive an error message like the “cannot estimate gas” error when you tap on “Swap”.

Instead, you need the “From” field to be estimated.

Step 4: Change the last numbers to zero

How to fix "cannot estimate gas" on PancakeSwap
  1. Change the last numbers of the token that you’re buying to zeroes* (e.g. if you’re trying to buy 155.958 ANKR, change it to 155.000).
  2. Swap the tokens!

*When you’re buying a token, you need the “From” field to be estimated.

In most cases, changing the last numbers of the token that you’re buying to zeroes will fix the “cannot estimate gas” error.

However, if the last numbers of the token that you’re trying to buy are already all zeroes, try changing it to random numbers.

For example, if you’re trying to buy 155.000 ANKR, try changing it to 155.958.

If you’re still getting the “cannot estimate gas” error, try changing the numbers in the “To” and “From” fields to random ones until the transaction succeeds.

This is because the error message is usually caused by the number of tokens that you’re trying to swap.

Conclusion

Generally, if you’re buying a token, make sure that the “From” field is estimated.

To do so, you need to change the last numbers of the token in the “To” field.

On the other hand, if you’re selling a token, make sure that the “To” field is estimated.

To do so, you need to change the last numbers of the token in the “From” field.

This will mitigate any transaction errors, such as the “cannot estimate gas” error.

Further reading

Best International Trading Brokers in 2021

How to Buy Dogelon Mars (ELON)

How to Buy HODL Coin (HODL)

About the author

Lim How Wei

Lim How Wei is the founder of followchain.org, with 8+ years of experience in Social Media Marketing and 4+ years of experience as an active investor in stocks and cryptocurrencies. He has researched, tested, and written thousands of articles ranging from social media platforms to messaging apps.

Lim has been quoted and referenced by major publications and media companies like WikiHow, Fast Company, HuffPost, Vice, New York Post, The Conversation, and many others. One of his articles about the gig economy was quoted by Joe Rogan who hosts The Joe Rogan Experience (arguably the most popular podcast in the world), in the This Past Weekend podcast by Theo Von.

In his free time, Lim plays multiple games like Genshin Impact, League of Legends, Counter-Strike, Hearthstone, RuneScape, and many others. He creates guides, walkthroughs, solutions, and more on games that he plays to help other players with their progression.