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

Display an estimate of the amount of the next staking reward #10

Open
banool opened this issue Jan 9, 2023 · 2 comments
Open

Display an estimate of the amount of the next staking reward #10

banool opened this issue Jan 9, 2023 · 2 comments
Labels
p0 High priority

Comments

@banool
Copy link
Owner

banool commented Jan 9, 2023

Not sure how possible this is, but if it's somewhat doable, we should try it.

@banool
Copy link
Owner Author

banool commented Jan 10, 2023

From Kevin:

  1. Get the stake pool address from the staking field (of type StakingInfo) under the VestingContract resource in the vesting contract adresss. Take note of the remaining_grant field in VestingContract
  2. Fetch the StakePool resource for the stake pool address. Take note of the active stake amount.
  3. (Active - remaining_grant) * (1 - commission_rate) = rewards not yet requested for unlock. Commission rate is currently 12% so likely you can just hardcode it.
  4. You can then multiple this value by the shareholder's share amount in the VestingContract's grant_pool and divide by the total original grant (total_coin in grant_pool)
  5. Only tricky part is calculating what's already in flight (rewards being unlocked) as that can includes the operator commission as well. It would take more data stitching to correctly compute that amount

@banool
Copy link
Owner Author

banool commented Jan 10, 2023

Partially addressed by #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0 High priority
Projects
None yet
Development

No branches or pull requests

1 participant