metamask – How Does Metamask Calculate Its Suggested Gas Fees?

gasgas-estimategas-limitgas-pricemetamask

How does metamask come up its suggested gas fees? How does it come up with a certain amount?

What is it optimised for? Should you just use it or should you set your own?

Best Answer

It uses web3.eth.estimateGas (https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html), which basically runs the transaction locally and returns the amount of gas used. It's pretty good most of the times but it can definitely get it wrong. Not sure in which specific cases though.

Related Topic