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

Estimated realized inflation #1280

Merged
merged 9 commits into from May 15, 2024
Merged

Estimated realized inflation #1280

merged 9 commits into from May 15, 2024

Conversation

bobo-k2
Copy link
Contributor

@bobo-k2 bobo-k2 commented May 8, 2024

Pull Request Summary

Estimated realized inflation calculation (ref). The calculation calculates slope from first block of the current cycle till the current block and assumes the same slope until the end of the period. This estimation introduces an error which will decrease after stakers clam their rewards (after first build and earn subperiod) and decrease even more as we are approaching the end of the current cycle.

We have beens struggling how to display inflation with just one meaningful number and seems this is the best way so far. In the next iteration we plan to add inflation chart as defined in the document referenced above.

image

Check list

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

@bobo-k2 bobo-k2 marked this pull request as ready for review May 8, 2024 11:16
Copy link

github-actions bot commented May 8, 2024

Visit the preview URL for this PR (updated for commit a311277):

https://astar-apps--pr1280-feat-realized-inflat-72fnz0sv.web.app

(expires Tue, 21 May 2024 11:15:10 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: dd76fe72958fe2910fef9d53f0b4539b82b849db

[$api],
async () => {
estimatedInflation.value = await estimateRealizedInflation();
console.log('Realized inflation:', estimatedInflation.value);
Copy link
Member

Choose a reason for hiding this comment

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

Let's use console.info if you want to show this in the console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this is not needed. Removed in e120bdb

src/hooks/useInflation.ts Outdated Show resolved Hide resolved
@gtg7784 gtg7784 self-requested a review May 14, 2024 11:16
Copy link
Contributor

@gtg7784 gtg7784 left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

@bobo-k2 bobo-k2 merged commit d121a9c into main May 15, 2024
9 checks passed
@bobo-k2 bobo-k2 deleted the feat/realized-inflation branch May 15, 2024 07:18
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.

None yet

3 participants