-
Notifications
You must be signed in to change notification settings - Fork 767
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
Configurable compounding staking reward #466
Comments
Nice! I thought about exactly this some time ago :D |
I wonder who is really asking for this? In general, it seems that we should only support 1 account to be paid in such a manner, or else we will double the base cost of all reward payouts since it will potentially update 2 accounts instead of 1. |
What if we just add a variant to pub enum RewardDestination {
...
Split(Perbill),
} such that this splits between pub enum RewardDestination {
...
SplitStash(AccountId,Perbill),
SplitStake(AccountId,Perbill),
} EDIT: still updates two accounts so still might not be the right change |
@4meta5 yeah, unfortunately that doesnt satisfy my concern. The solution would be to update free balance and locked balance of the stash account, and then if they wanted to move funds out of the stash account, they could do that manually, but may not be very friendly... so i go back to my question, who was asking for this? lol |
Exactly, this is not friendly at all since you need to your stash key every time.
tbh I wanted something like this personally and thought it would be something useful, and the rest is public here. I don't think anyone has asked for it, but I believe once it exists, people will use it. I would personally not drop this issue just because it complicates weights. Many things do, and we should consider them further before being discarded. Also, it doesn't seem to be that the weight situation is much hard to solve. Something as simple as: "payout transaction will have to mention the number of compound payout targets (where we assume the rest are singular)" will solve it, to the best of my knowledge. |
So I am a validator, and i have 100 nominators. 30 of those nominators have a 2 account payout scheme like designed in this thread. So I would need to call and to know that, I would need to query all 100 nominators for each era to know their staking preferences? And then what if in the future someone asks to support 3 payment locations? Should we do it? This all sounds like you are imposing your specific needs onto an otherwise pretty clean API. At this point, it would make more sense to me to just double the weight of payouts. But that will make batching and whatever else slower, which really isnt a big deal. But i think making the API worse for this feature is a no-go to me. |
That's a fair comment if no one other than me would have need this. I am not sure how to ask around about it, but my gut feeling is still that many people will use this if it existed. In which case then making the payout default weight 2x is fine. |
I can see this being useful, but I don't think it would be widely used. An example use case would be some validator that wants to pay for their infrastructure costs via DOT/KSM - they can specify a percentage to not get re-staked that they can then cash out and pay for server costs with. I don't think it would be widely used though, and if it complicates things a lot, maybe not worth implementing at the moment as the amount of validators / nominators is still growing (given the previous issues of weights with election solutions). |
It's also not too hard to manually compound just by issuing a transaction or two on-chain to bond extra. Maybe we want an alternative mechanism where arbitrary accounts can contribute to the bond of some stash. Open question about how important permission to do so is. I suspect we can allow stashes or controllers to submit a permission value which is one of
Then it should be relatively simple to handle more complicated compounding with a bot that just invokes |
One other idea is to do this: pub enum RewardDestination<AccountId> {
Compound(RewardDestination, Perbill, RewardDestination)
...
} And then |
Moonbeam now supports auto compounding a percentage of rewards. Simple but effective split of rewards as they come in. I can see this being useful if I am a nominator and I want to split my daily rewards simply to cash out a percentage for personal expenses, or diversify my portfolio from an investment perspective. I may wish to take 50% of my rewards and convert it into another token, or send it to a pool that I want to bolster.
If the split mechanism is in place, we could build upon this in various ways, such as sending the free balance chunk to smart contracts that can do various things with those rewards. In any case, I think a simple split to free balance, to the same account, is worthwhile doing. I like @ruseinov's suggestion, but do we need an additional variant? We could simply migrate:
to
Where In regards to weights, the split would just require both a deposit into the stash and a read + write operation of ledger. So would be the combined weight of the current
|
This issue has been mentioned on Polkadot Forum. There might be relevant details there: |
* Refactor pending transactions * fmt * Pin substrate `b391b82` * Use transaction graph re-exports * Fix integration tests * Styling
The
RewardDestination::Staked
is essentially compounding staking rewards, which is pretty cool. An additional feature could be configurability about what percentage of the rewards to be compounded and which percentage not. To do that, you need to specify a pair of current staking rewards, and a singleperbill
value (that ratio of the second will be the leftover).This is useful for strategies (that I think are common) where you want
x%
of your rewards to be compounded and(1-x)%
to be saved, or cashed out etc, and preferably you don't want to use your stash key every time you want to make such a split.I am happy to work on this myself or mentor. Feedback on the idea itself would also be welcome (@wpank @shawntabrizi).
The text was updated successfully, but these errors were encountered: