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

Add dynamic balances with mock rewards and distribution #299

Merged
merged 69 commits into from
Apr 6, 2023

Conversation

shanejearley
Copy link
Contributor

@shanejearley shanejearley commented Mar 28, 2023

@ccali11 for #295 note the change to contract interfaces.

Some changed methods:

  • getUserBalance(userAddress) to get the stake and rewards for a given user
  • getBalance() to get the stake and rewards for the manager
  • getStakedPoolIds() to get staked (active) pool IDs
  • getReadyPoolIds() to get ready (open) pool IDs
  • getPool(poolId) to get pool details (deposits, and validator public key and operator IDs if staked)

Note, rewards will be zero if compound is enabled (npm run dev:ethereum --compound or npm run test:ethereum --compound) but returned stake will increase as rewards are distributed at large.

@shanejearley
Copy link
Contributor Author

@hawyar see notes above as this will eventually feed into #256 and happy to discuss before then.

@shanejearley
Copy link
Contributor Author

@ccali11 ok, I'm done making changes to this branch. Once your PR #298 is merged to develop I will merge that into this branch, and then you can work on adapting to the new interfaces in a new branch off of this one (to avoid breaking develop).

@shanejearley
Copy link
Contributor Author

@ccali11 @DemogorGod note the updated dev script flag options in the Serve section here. We're using the compounding feature by default (Steve you can remove the option switch in the UI for now), and classic mode (no compounding) is behind a flag. The simulation flag might be helpful to auto populate some stakers for development. Also, we're limited to two validators right now (so you'll get an error once you stake enough to activate a third validator). I can remove that limit soon. Rewards are simulated by default, and come in pretty frequently (not set to any realistic cadence at this point), so you can play with displaying updating balances.

In the compounding (default) mode, user rewards will be zero, but their stake will increase as rewards are distributed, by definition.

@shanejearley
Copy link
Contributor Author

Also @DemogorGod just for your awareness, we won't merge this to develop until @ccali11 completes #295 and merges into this branch.

Copy link
Contributor

@ccali11 ccali11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled down. Ran. Adapted to v1 contract interface.

@ccali11 ccali11 merged commit c965e86 into develop Apr 6, 2023
@ccali11 ccali11 deleted the feature/balances branch April 6, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants