Staking Calculator Algorithm

Hi all,

I am presently writing an ICP rewards staking calculator, I have got it to this point (see image) and the values seem wrong, as in way off, where please is the best place to get the information required so that I may finish this beastie off?

I think a well done staking calculator is vital to the ecosystem so any advice would be much appreciated.

Many thanks, Mantrid.

2 Likes

i would have a look at the dfinity neuron sandbox tool here:

https://klgza-cqaaa-aaaak-qcz5a-cai.icp0.io/

the code you’re probably interested in starts at around line 300 of index.js

it is not as simple as an apy calculator, because of the voting rewards function. There is more than one function in which the output could be very different over time.

I’m not sure whats going on with your APY calculator without any code but it appears it is outputting 2x as much as it should for some reason.

1 Like

It’s okay guys, I fixed it!
It works I think! :smiling_face_with_sunglasses:

1 Like

thank you hero, much appreciated, will use to validate.
it’s never going to be calculated with 100% accuracy due to the algo, but this should help, many thanks.

the more tools we have the better! I hope you can iterate and improve on the neuron sandbox UI!

2 Likes