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

Bot to update users stake #532

Open
nakul1010 opened this issue Oct 6, 2023 · 0 comments
Open

Bot to update users stake #532

nakul1010 opened this issue Oct 6, 2023 · 0 comments
Assignees
Labels
bug Something isn't working prio:high

Comments

@nakul1010
Copy link
Member

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

@nakul1010 nakul1010 added the bug Something isn't working label Oct 6, 2023
@nakul1010 nakul1010 self-assigned this Oct 6, 2023
@nud3l nud3l added this to Backlog Oct 6, 2023
@github-project-automation github-project-automation bot moved this to New 🆕 in Backlog Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:high
Projects
Status: New 🆕
Development

No branches or pull requests

1 participant