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
Conversation
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 |
src/hooks/useInflation.ts
Outdated
[$api], | ||
async () => { | ||
estimatedInflation.value = await estimateRealizedInflation(); | ||
console.log('Realized inflation:', estimatedInflation.value); |
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.
Let's use console.info
if you want to show this in the console
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.
Actually, this is not needed. Removed in e120bdb
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.
Thank you! LGTM
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.
Check list