PancakeSwap: How to solve “Cannot Estimate Gas” issue in 2022

Paigambar Mohan Raj
Source: Airdrop Alert

PancakeSwap (CAKE) is one of the most popular decentralized exchanges (DEX) and automated market makers (AMM). It is powered by the Binance Smart Chain and allows anyone to swap BEP-20 tokens quickly and securely.

Despite its popularity and utilities, many users on PancakeSwap continue to face the infamous “Cannot Estimate Gas” error on the platform. Users usually see an error message saying:

“The transaction cannot succeed due to error: cannot estimate gas”.

Source: Followchain

Let’s take a look at how this error occurs, and how one can solve it.

What causes the “Cannot Estimate Gas” error on PancakeSwap?

On PancakeSwap, “cannot estimate gas” signifies that the exchange is unable to estimate the transaction cost. It frequently occurs when the number of tokens has too many decimal places.

For example, you can get the error notice if you swap BNB with 155.968325 ANKR. This is due to the token’s excessive number of decimal places.

However, there are other reasons why this error may occur. The error message is also prompted when attempting to buy a scam token that has been flagged. PancakeSwap will prevent such a transaction.

Additionally, some transactions may require a manual gas limit to be set. The transaction is not going through because the gas limit is too low. Your transaction may also fail due to a low slippage tolerance.

Now let’s get to how one can resolve these issues.

How to solve the “Cannot Estimate Gas” error?

Solution 1: Change your slippage tolerance to 12%.

To begin, you must first open PancakeSwap. Choose the tokens you wish to swap once you’re on PancakeSwap. For this, go to the “To” field and select the token you want to buy.

Then, in the “From” section, choose the token you want to swap for it.

Source: Followchain

The next step is to adjust your slippage tolerance. To do so, go to the Settings icon and tap it. The Settings pop-up will appear after you tap on the Settings icon. A “Slippage tolerance” field can be found in the Settings pop-up. Put “12” as your slippage tolerance in the field.

Alternatively, you can gradually increase your slippage tolerance.

Start with a 2% slippage tolerance and work your way up to 4%, 6%, 8%, and even more. This will enable you to determine the transaction’s lowest slippage tolerance.

If you’re trying to buy a token like Safemoon, though, you’ll need to establish a 12% slippage tolerance. This is due to the fees associated with the token.

Solution 2: Change the amount to a whole number.

To begin, fill in the “To” column with the token you want to purchase. Then choose the token you’d like to replace it with (e.g., BNB, Ethereum).

After that, enter the amount of BNB or Ethereum you’d like to exchange for the token. If you wish to swap 0.04515 BNB, for example, enter “0.04515” in the “From” field. The “To” field will be estimated as a result of this.

Source: Followchain

While purchasing a token, however, the “To” field should not be the one to be estimated. When you tap on “Swap,” you may get the error message “cannot estimate gas” if the “To” field is estimated. The “From” field must be filled instead.

Moreover, change the last two digits of the token you’re trying to purchase into zeroes. If you’re looking to buy 155.958 ANKR, for example, modify that to 155.000. This will usually resolve the “cannot estimate gas” error.

Source: Followchain

If the last numbers of the token you want to buy are already all zeros, try altering them to random numbers.

If the “cannot estimate gas” problem persists, try substituting random values in the “To” and “From” fields until the transaction completes.

This can happen because the number of tokens you’re trying to swap is usually the cause of the error notice.

Solution 3: Increase Gas Limit on PancakeSwap

First, go to the settings menu on PancakeSwap. In the Global Settings, change transaction speed to “Fast” or “Instant”.

This will naturally impact the price, but it may also resolve the issue.