The cause is that
Math.floor(lastFullDay - lastClaimDay) / SECONDS_IN_DAY is larger then
centralState.currentDayIdx that produces a negative array index in
calcRewards(...) , please fix it.
My guess is that this problem occurs only if user’s last claim day is in 2021.
This should already be fixed. Thanks for catching
It doesn’t seem been fixed, the only change of the code is adding a try catch block around the statements which causes the error, it only hides the error.
And because of that, there should be a
Rewards to collect row sits between
Rewards collected, but it is now disappeared, and I can’t see the rewards collected.
I’m wondering if I can claim the rewards now, is the onchain calculation logic the same as the frontend?
You are right I added a try/catch as a quick fix to allow people to claim their rewards before rewriting the logic that compute the approximate rewards to collect. It does’t not impact the on-chain logic at all.
I’ve dug a little deeper to the rewards code, and found a strange thing, here is what I did.
centralState.rewards, which is a array of size 1095 (3year); I dumped the array with some calculation, and got the below result:
centralState.rewards.map(x => x.toNumber() / Math.pow(2, 32) * 100)
[0 … 99]
Historical Data chart on the bottom of staking web page has the same daily return percentage number as the
centralState.rewards array, and the start date of that chart is
HERE IS THE STRANGE THING
I’ve claimed once at
2021-12-27, and with some calculation, the claimed reward I got is exactly matched with the sum of the array above! (from index 2 to index 6), which means the
centralState.rewards's start date should be
2021-12-21. AND it is different than the chart you provide.
So, what exactly is the story behind this, can someone explain a little bit more?
@bigsan It’s related to the Solana outage we had over the last few days (see this post [Announcement] Staking and Solana outage) where several days have been merged together
There is a
Crank transaction happend about 1 hour ago,
but the front end still doesn’t show the rewards, I saw a lot of txs on chain who claimed reward but no FIDA transfer happened.
Hope that can be fixed sooooooon…
You should be able to claim now
What I’m caring about is NOT claiming reward, but to know the amount of reward before claiming.
Is there any issue that it can not be fixed?
You can deduce this amount by looking at the central state circular buffer and the last claimed time of your stake account. If your stake account is in advance compared to the central state (due to Solana outage, see my post above) then you have already claimed all the rewards of the past days and your stake account last claim day will be adjusted with the central state the next time you claim
Did not have time to update the UI if this what you are asking for.
I sent a claim reward request, it succeeded, but I got 0 reward, how’s that possible?
My last claimed day is 2021-12-27.
Because I sent a
Claim rewards yesterday, now I can see the
Rewards to collect row on the UI.
BUT the amount contains only yesterday’s return. All daily returns between yesterday and last claim day are lost! Not as you said in the announcement
added to the next day.
This should be considered a bug, and the reward are actually lost, please take my use case as an example.
Mind giving your address so I can have a look?
I’ve sent you a private message, thank you.
@bonfida I also have a similar issue. I last unstaked on 19 Jan 2022 and have no rewards to claim. I even tried to send the unstaking instruction but no token was accrued
unstake tx does not make you claim any rewards so I assume you mean
See the post here [Announcement] Staking and Solana outage about the crank days missed. Some of days were merged together because of this, so by bumping the central state to catch up, some people will claim 0 because they already claim their rewards during the days that were merged. The total amount of rewards does not change, it’s just the days over which they are distributed that change.
thanks yes I meant
claim. I saw the announcement and assume the fix is already live? if yes I don’t understand how from Jan 19 to yesterday (8 days, so since before the Solana outage) there were no rewards to claim as I didn’t claim anything in between which could have been merged
I’m new to this forum and I registered cause I have the same problem.
I created new staking account and Rewards to collect are not displayed.
Could you please explain/fix this issue? Or is it something I’m doing wrong?
Looking at the deposit time and the time of your post it’s possible that you had nothing to collect when you took the screenshot
Did you ever hear anything back on this?