Skip to content
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

Closed
wants to merge 14 commits into from

Conversation

trizin
Copy link
Contributor

@trizin trizin commented Jun 25, 2024

#1298

  • ppss parameter to toggle "fetch stake and accuracy per feed from live feeds"
  • Function to fetch stake and accuracy and tests

@trizin trizin marked this pull request as ready for review June 25, 2024 11:24
@KatunaNorbert
Copy link
Member

Good quick solution for calculating this 2 values, should offer much accurate environment for predictoor simulations.
My only comment is that the periods for calculating this values inside the accuracy endpoint are fixed, so this could become less relevant depending on the period you are running your simulations on.
Ex: for 5m fields the accuracy and stakes are calculated over the last week, but the simulation could be run over the last month

@trizin trizin linked an issue Jun 25, 2024 that may be closed by this pull request
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
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

@KatunaNorbert KatunaNorbert Jul 1, 2024

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch thanks

@trizin trizin requested a review from KatunaNorbert July 3, 2024 11:21
Copy link
Member

@KatunaNorbert KatunaNorbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@trizin
Copy link
Contributor Author

trizin commented Jul 17, 2024

Closing in lieu of #1257

@trizin trizin closed this Jul 17, 2024
@trizin trizin deleted the issue1202-define-stake-and-accuracy-per-feed branch July 17, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sim] Fetch average stake and accuracy from live feeds
2 participants