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

How staking reward compounded? #21009

Open
nishit9457 opened this issue Jan 30, 2025 · 4 comments
Open

How staking reward compounded? #21009

nishit9457 opened this issue Jan 30, 2025 · 4 comments
Assignees
Labels

Comments

@nishit9457
Copy link

nishit9457 commented Jan 30, 2025

Hi Team,

I want to show the accrued reward amount against any staking transaction for a specific time period/ epoch (old epoch also). So I am calculating this based on staking amount, APY and commission rate and other values for respective epochs.

I just want to confirm that how staking reward is compounded whether weekly or monthly or suggest any other way to calculate staking reward.

Thanks

Copy link
Contributor

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

@emmazzz
Copy link
Contributor

emmazzz commented Jan 30, 2025

Hi @nishit9457,

Staking rewards are compounded each epoch (around 24 hour long) so they are compounded daily. We have this handy method that, given a stake object and staking pool, calculates the rewards it has accrued at a given epoch. This method may not provide entirely what you need, but should be a good reference for your calculation.

Hope this helps!

@nishit9457
Copy link
Author

Thanks

@nishit9457
Copy link
Author

nishit9457 commented Feb 3, 2025

Hi @emmazzz , I am doing calculation based on my understanding trying to represent below and in attached excel as well but some how reward is not matching with current reward. I have tried calculating it by considering epoch APYs from when it was staked to current with multiple scenarios.

Please let me know where am I doing wrong.

Address - 0xb4f42571101827758f55a9b998a1251892402fbd4dce90da3373625298091627
Validator - 0x9c7376a3f903cbe1f467a4edbefb54bb5a2f10886496c591ca955c22f0ae10c9
Stake Amount - 150,000
Active Epoch - 70

Delegated share % = delegatedStake / stakingPoolSuiBalance * 100. In our case it would be 150000 / 2739799 X 100 = 0.547%
Reward pool for Validator Stakely = 203163.7476
Validator commission = 5% (from commissionsRate – 500/100)
Validator will take 5% of 203163.7476 which is 10158.187 and rest 193005.55 would be available for distribution
Address share would be 193005.55 * 0.547% = 1055.74

Now given the reward was earned but not redeemed, this stake + reward would earn interest per the APY rates (5.38 for epoc 70).

Further compounding calculation explained in excel.

Please guide if anything wrong with this.

Interest Calculation 0xb4f42571101827758f55a9b998a1251892402fbd4dce90da3373625298091627.xlsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants