When exchanging tokens on PancakeSwap, you may come across an error stating “Cannot estimate gas”. The full error message that is displayed is the following:
The transaction cannot succeed due to error: cannot estimate gas; transaction may fail or may require manual gas limit
When this error appears, it prevents users from buying or selling tokens on PancakeSwap. It happens due to a variety of reasons but it’s a common issue that most users face. In this tutorial, we’ll show you how to get it fixed so that you can swap your tokens without any problems.
Table of Contents
Why Does PancakeSwap Show the “Cannot estimate gas” Error?
The most common reasons for PancakeSwap displaying this error are due to the following
- Low slippage tolerance: increasing the slippage tolerance may help the transaction succeed. The drawback is that you may not get a good price for the swap.
- Lots of trailing zeroes: If your token amount has a lot of zeroes in the ending, this may lead to the gas error that you are getting. For example, trying to swap 1,000,000 Safemoons for BNB may display an error because of a high number of trailing zeroes.
- Too many digits after the decimal points: For example, if the amount of your token is 125.3679142, then PancakeSwap displays the transaction failure error due to having a lot of digits after the decimal points.
How to Fix “The transaction cannot succeed due to error: Cannot estimate gas” Error on PancakeSwap
Here are a couple of solutions that will help you fix the error and swap your tokens on PancakeSwap without any gas fees error.
1. Increase the slippage tolerance
Having a low slippage tolerance such as 1-3% may be the reason why PancakeSwap is unable to exchange the tokens. To fix this, you have to increase the slippage token to a higher amount. Here’s how:
1. Open PancakeSwap and go to the Exchange screen.
2. Click the gear icon to access Settings.
3. Change the slippage tolerance to a higher amount. Start with 5% and gradually increase the amount until the transaction goes through successfully. Most users have had success when the slippage tolerance is set to 12%.
Keep in mind that the higher the slippage tolerance, the lower the exchange rate will be. In other words, you’d be getting a lower amount of tokens during the exchange.
4. Close the settings and now try swapping your tokens to see if it works. If not, try the next solution.
2. Remove trailing zeroes
If your token amount ends with a lot of zeroes, then change the last few digits to non-zeroes. For example, if the token amount that you want to sell is 125000, change it to 124989.
Due to some reason, PancakeSwap is unable to perform the transaction when the token amount has a lot of trailing zeroes. As such, getting rid of some of the ending zeroes helps fix the issue.
3. Reduce digits after the decimal point
Similar to the previous one, PancakeSwap shows this error when the token amount has a lot of digits after the decimal point, such as 129.3151439. In such cases, PancakeSwap is unable to calculate the transaction fee and displays an error. The solution is simple. The number of tokens that you want to sell should be rounded down to the nearest whole number, such as 129 or 129.3.
Wrapping Up
The gas fee error is a common issue that most PancakeSwap users face. Fortunately, it’s very simple to fix the problem. All that needs to be done is to increase the slippage tolerance, get rid of the trailing zeroes in the token amount, or round down the token amount to the nearest whole number.