-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Tiffany/gas pricing #1614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiffany/gas pricing #1614
Conversation
|
I just created this weighted average function that uses the weighted average by recency of the block in the sample, in order to calculate the weighted average block time for the time_based_gas_price_strategy function. I used n/N (where N is the sample size and n is the number of the block in the sample 1 through to N, with the Nth block being equivalent to the 'latest' block) as a simple weighting function that could capture the idea of weighting more recent blocks more heavily. Do you think that such a weighting function would achieve the goal of more accurately deciding a gas price during a time of sudden network congestion? |
kclowes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the right approach to me @tmckenzie51! Thank you! I think this deserves to be it's own strategy, meaning that I think we should leave the simple time based strategy, and have a separate weighted strategy. I'd like to see some more testing around this strategy to make sure it's working as expected, and there is also some white space that needs to be cleaned up. I'll plan on addressing this feedback since I'm sure you are busy with other things now :)
@kclowes That makes sense to have it as a separate strategy. Thanks for pointing that out, and thank you for the feedback and for handling this for me. :) |
a6520d9 to
68a1fae
Compare
3ffcf6e to
06f4de7
Compare
|
@marcgarreau I think this is good to go if you want to take a look and give final approval! |
wolovim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice contribution, thanks @tmckenzie51!
Add weighted kwarg to time_based_gas_price_strategy
06f4de7 to
dc9cae2
Compare
What was wrong?
Related to Issue #1463
How was it fixed?
A recency based weighted average of the block time is calculated. This weighted_avg_block_time is then used to calculate the probabilities required to determine the best gas price.
Todo:
Cute Animal Picture