Open ErikBjare opened 6 years ago
We should probably call https://web3js.readthedocs.io/en/1.0/web3-eth.html#getgasprice and halve it (or divide by something else) instead of guessing the price.
That returns the median, which will always be pretty high for our use case (currently 8 for the last 1,500 blocks)
Edit: A better way to get a low gas price would be to check the SafeLow price from https://ethgasstation.info/json/ethgasAPI.json
I meant we would use some fraction of the median, to guard against price spikes. But safelow looks great!
Trying out Augur and noticed this:
"Retry with a higher has price" is always an option in case the network doesn't offer cheap transactions at the time. Another case (imo) for just leaving a low price.
Another argument, https://ethgasstation.info/ also notes:
Note: Estimates not valid when multiple transactions are batched from the same address or for transactions sent to addresses with many (e.g. > 100) pending transactions
In which case transactions could presumably be cheaper.
Gas price estimator: https://ethgasstation.info/
How to set gas price for a transaction: https://ethereum.stackexchange.com/questions/41408/how-can-i-set-the-gas-price-while-deploying-a-contract-with-web3-js
A low gas price of 1 Gwei/gas would cost $0.009 on the main net and be confirmed quickly enough. 1 cent transaction fees ftw :tada: