As mentioned in documentation eth.gasPrice returns the current gas price. The gas price is determined by the x latest blocks median gas price.

I was relying on this method to estimate current gas price that I send along with my transactions. But recently I faced an issue, most of my transactions are pending.

When I looked at the transactions, the gas price provided was 35 GWei, while on eth gas station, the safe low gas price is 57 GWei.

I checked the value of eth.gasPrice` on my node and this resulted to 25000000000 (25 GWei).

Why the value of eth.gasPrice is so low when the gas price of the network is increased to double.

I also checked some recent transactions on etherscan : 0xf5ccc6ecc36b318c8ac9794e2b472fa2f9b3acc0b2adf662b4f858b76a69c278, 0x123789fd42ad2037fff8bfaca3caeb6bec179b4630588902ae95c9515c742432, 0xf78960adb886d9a31549a04154ce459e00896dac6c7156e749c63f6755c5a4c9

All of them has gas price of 60 Gwei. So why is eth.gasPrice is giving me 21GWei? Can I rely on this method to estimate current gas price? Are there any alternatives?

edit: Recently the values returned by eth.gasPrice has been to 2 GWei, and the transactions (here) are pending for more than a day. While I can see the safe-low is around 12 Gwei.This function ditched me again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.