SuperuserLabs / thankful

Support free culture by automatically sending cryptocurrency to the creators of the content you love.
https://superuserlabs.github.io/thankful/
Mozilla Public License 2.0
115 stars 6 forks source link

Use a low gas price #34

Open ErikBjare opened 6 years ago

ErikBjare commented 6 years ago

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:

Powersource commented 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.

ErikBjare commented 6 years ago

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

Powersource commented 6 years ago

I meant we would use some fraction of the median, to guard against price spikes. But safelow looks great!

ErikBjare commented 6 years ago

Trying out Augur and noticed this: image

"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.