-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: integrate staking pallet into vault-registry and nomination #165
Conversation
c74c265
to
563108b
Compare
563108b
to
ab87115
Compare
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
ab87115
to
82424e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fully review this, I need to understand what the desired outcome of the system is.
Open questions for me are:
Staking pallet
- What does the staking pallet do?
- Is this our way of tracking collateral across vaults and nominators?
- Can we use this with multiple currencies as well?
- What exactly is the stake? Is that just the amount of e.g., DOT deployed by the vault?
Rewards
- What are the implications on the rewards? In our current docs, fees are distributed to vaults 90% based on issued_tokens and 10% based on locked collateral (see https://docs.interlay.io/#/vault/overview?id=pool-based-fee-distribution). It looks like to me rewards are currently only paid based on locked collateral rather than issued_tokens?
- In the future, we will still want to be able to pay rewards on both issued tokens and on collateral locked. In case this is currently not implemented, we need to add this again.
Specification
We need to add a specification for the reward and staking pallet.
Tests
Overall, this changes a lot of logic without adding tests. In the reward crate, a lot of tests are deleted. Please add tests for checking that the assumptions for the reward distributions hold.
Staking pallet
Rewards
|
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
Signed-off-by: Gregory Hill gregorydhill@outlook.com
Integrates the new staking pallet into the vault-registry, nomination pallet and runtime. The main purpose of this is to centralize the stake accounting - many of the fields on the Vault struct have been removed and the Nominator struct is no longer required. Another reason is for reward distribution since rewards should not be accrued on slashed stake.