Describe the bug
The update_user_stake call needs to be periodically called when there is a significant change in the percentage of users' stake. This is crucial to ensure that Staking rewards are accurate for users.
Solution
To address this issue, follow these steps:
Create an additional member in the workspace called stake_updater.
Implement a loop to iterate through staked accounts.
Within the loop, perform the following tasks:
Calculate both the initial and final rewards for each account.
Check if the difference between the initial and final rewards exceeds a certain threshold (X%).
If the difference is greater than the specified threshold, invoke the update_user_stake extrinsic to update the user's stake.
Describe the bug The
update_user_stake
call needs to be periodically called when there is a significant change in the percentage of users' stake. This is crucial to ensure that Staking rewards are accurate for users.Solution To address this issue, follow these steps:
Create an additional member in the workspace called stake_updater.
Implement a loop to iterate through staked accounts.
Within the loop, perform the following tasks:
update_user_stake
extrinsic to update the user's stake.Additional context InterBtc side PR 1097