Skip to content

Bot to update users stake #532

@nakul1010

Description

@nakul1010

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.

Additional context
InterBtc side PR 1097

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

New 🆕

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions