-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feat #1202 - Fetch stake and accuracy per feed from live feeds #1295
Conversation
Good quick solution for calculating this 2 values, should offer much accurate environment for predictoor simulations. |
pdr_backend/sim/sim_engine.py
Outdated
data = get_avg_stake_and_accuracy_for_feed(self.predict_feed) | ||
if data: | ||
self.others_accuracy, self.others_stake = data | ||
self.others_stake = self.others_stake.amt_eth |
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.
I think the self.others_stake
is referring to total stake for an epoch, but the stake amount from the api( self.others_stake
) is per day, so for an accurate stake you have to divide that by number of epochs
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.
good catch!
tot_stake = others_stake + stake_amt | ||
others_stake_correct = others_stake * pdr_ss.others_accuracy | ||
tot_stake = self.others_stake + stake_amt | ||
others_stake_correct = self.others_stake * self.others_accuracy |
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.
Just found another issue here, the self.others_accuracy
value when accuracy endpoint data is used is in this format 52.3
which multiplied by total stake gives a higher value than the total stake.
I think what is expected is that the self.others_accuracy
values is in this format 0.523
, this was the others_stake_correct
is a lower number than the self.others_stake
Possible fix is to divide the other_accuracy value by 100
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 catch thanks
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.
LGTM
Closing in lieu of #1257 |
#1298