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

Add "per epoch" calculations option in addition to "per year" #5

Open
vsubhuman opened this issue May 22, 2018 · 1 comment
Open

Add "per epoch" calculations option in addition to "per year" #5

vsubhuman opened this issue May 22, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request must Obligatory feature

Comments

@vsubhuman
Copy link
Member

"Restaking" calculations are planned in #4. But in order for restaking to be more real-life-like - it should be calculated (optionally) on the "per epoch" basis, cuz people can theoretically restake profits every 5 days.

The whole calculations system should be reworked to do actual calculations on "the higher resolution" of epochs, and the year results will be calculated as aggregates. This will also allow to give users some more interesting intermediate results.

@vsubhuman vsubhuman added enhancement New feature or request must Obligatory feature labels May 22, 2018
@vsubhuman vsubhuman self-assigned this May 22, 2018
@vsubhuman
Copy link
Member Author

The complication is that it is not that obvious how to calculate the per-epoch inflation. I mean it might seem that actual decrease should also be gradual, so decrease at the last epoch of the year would actually be a little bit bigger than the decrease. For this to work - the per-epoch decrease should also be calculated in percents, but I am not sure for now how to derive a formula that would yield the same per-year decrease. For example:

If we have a reserve of 100 coins and a per-year decrease of 10% - then after year 1 the reserve if 90 coins. But if we have two epochs - it is (of course) not enough to just split the 10% in two and calculate (100 - 5%) - 5% cuz this would yield 90,25.

I'm positive there's a function already that allows to calculate the "step" percentages from a total period percentage and the number of steps (epochs), but I just don't know it yet. Need to google it.

Note: other option might be to calculate per-year percentage and then just divide the result coins into 73 epochs, so in out example we calculate 10% of 100 and then divide 10 in two and get 2 epochs of 5 coins. This would give us 73 completely equal epochs in a year and remove this "coolness" of a gradual decrease, but would also significantly simplify the calculations.

Additional question is: how IOHK plan to actually calculate this in the actual system? It might as well be that they will also just calculate (yearly decrease / 73) for each epoch, who knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request must Obligatory feature
Projects
None yet
Development

No branches or pull requests

1 participant