You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taking the situation of feeExempt as an example: wipeout = uint248((tokenBalance * rewardBalance + lastReward * stake) / (stake - tokenBalance))
The above expression is equivalent to: (wipeout + rewardBalance) = (wipeout - lastReward) * stake / tokenBalance
The left side of the equation represents the total reward(including we added) we need to receive, which is correct.
But there seems to be a issue on the right side of the equation, it should be the actual reward through calling sendReward function.
It is calculated through the following code:
As line-1 shows, actually wipeout shouldn't be _TokenInfo.totalReward, which should be _TokenInfo.totalReward -_ StacerInfo.lastReward. _tokenInfo.totalReward - _stakerInfo.lastReward means the value added by calling function addReward, which is wipeout.
So I think the correct equation may be (wipeout + rewardBalance) = wipeout * stake / tokenBalance, which can be used to derive the actual expression of wideout as (tokenBalance * rewardBalance) / (staked - tokenBalance).
Of course, it's also possible that I misunderstood. Please help me correct it.
The text was updated successfully, but these errors were encountered:
Taking the situation of feeExempt as an example:
wipeout = uint248((tokenBalance * rewardBalance + lastReward * stake) / (stake - tokenBalance))
The above expression is equivalent to:
(wipeout + rewardBalance) = (wipeout - lastReward) * stake / tokenBalance
The left side of the equation represents the total reward(including we added) we need to receive, which is correct.
But there seems to be a issue on the right side of the equation, it should be the actual reward through calling
sendReward
function.It is calculated through the following code:
As line-1 shows, actually
wipeout
shouldn't be_TokenInfo.totalReward
, which should be_TokenInfo.totalReward -_ StacerInfo.lastReward
._tokenInfo.totalReward - _stakerInfo.lastReward
means the value added by calling function addReward, which iswipeout
.So I think the correct equation may be
(wipeout + rewardBalance) = wipeout * stake / tokenBalance
, which can be used to derive the actual expression ofwideout
as(tokenBalance * rewardBalance) / (staked - tokenBalance)
.Of course, it's also possible that I misunderstood. Please help me correct it.
The text was updated successfully, but these errors were encountered: