-
Notifications
You must be signed in to change notification settings - Fork 996
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
Murisi/non compounding rewards #4285
Conversation
d5d0f54
to
b8bb543
Compare
be10d8f
to
3716fbd
Compare
1fc21d3
to
50ded64
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4285 +/- ##
==========================================
- Coverage 74.58% 74.57% -0.02%
==========================================
Files 339 339
Lines 111054 111004 -50
==========================================
- Hits 82834 82776 -58
- Misses 28220 28228 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
357505c
to
817bc6e
Compare
c359fd9
to
8d44120
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.
I'm very much in favor of this PR as it simplifies the shielded rewards logic but we'll need to wait for someone to review the economic outcomes of it
Actually, one small thing, I believe we need to review and update the shielded rewards estimate function:
We were handling the rewards with |
…rewarding locked NAMs.
8d44120
to
02625b3
Compare
02625b3
to
6c5662c
Compare
Thanks for reviewing! Maybe @cwgoes can chime in here? I think the key economic change is as follows:
I guess one (maybe less desirable) implication of this change/PR is that users can still get compounding rewards, but only indirectly. This would be done by unshielding reward NAMs (which would be undated) as soon as you receive them, and then immediately reshielding them. These reshielded NAM are no longer reward NAM and are dated, so they would now receive rewards. Unfortunately, I guess this would mean that those willing to do this trick would accumulate more NAM than those who do not or cannot do this. More precisely, those who do this will have exponential growth in their NAM balance/ownership while those who do not will only have a linear growth in their NAM balance/ownership since they are only earning shielded rewards on the principal amount locked in the shielded pool. (I'm not accounting for the gas fees paid when unshielding and reshielding in this line of thought though.) I'm not sure if this is acceptable from an economics/incentives perspective? Also, if this trick is profitable then it encourages lots of unshielding and reshielding transactions solely for the purposes of claiming rewards. Could this theoretically have a negative impact on other Namada activities or the privacy of those doing it? cc @brentstone |
@murisi I don't think unshielding and reshielding in order to take advantage of compounding rewards is an issue at all. Anyone is free to do this in proof of stake, for example. And I don't think the increased transaction volume is a downside at all (in fact, might be a net-positive). |
Good point, thanks! I'm not so familiar with the rewards estimation code and would need some time to go through it. @batconjurer is there a quick way to adjust the rewards estimate function for this PR so that it doesn't assume a compounding effect? It's probably just a question of checking for undated NAM rather than NAM at epoch 0, but I'd have to refresh my memory. But if grarco is willing to help, I'll let him 😉 |
@murisi I can help here but I'll wait to see if we want to move forward with this PR |
I'm going to close this, as I think we've decided to forgo this PR, still sound good @murisi? Here's a summary of the motivation for closing (@cwgoes):
Other things discussed and confirmed:
|
Agreed. As a minor clarification: the PR #4285 looks simpler because a lot of the logic it relies upon (like VP and transaction WASM changes, and introduction of storage keys) was factored out into #4303 (which was recently merged into |
Describe your changes
Based on #4303 . Implemented a version of MASP rewards where rewards do not compound. More precisely, the NAM received for locking tokens in the MASP does not itself receive NAM rewards. This version was implemented as an alternative to the compounding version in case the rounding errors become significant. This PR was also made to demonstrate that non-compounding rewards are also possible, and hence leave this possibility on the table.
In order to achieve the goal of non-compounding rewards, the following changes were made:
The overall outcome of these changes is that while the PD-controller is untouched and the MASP pool's transparent balance still grows at the same rate, the portion of rewards that would have gone to the reward NAM locked in the MASP has now been redistributed to the non-reward NAM locked in the MASP.
Additionally, this PR reduces the amount of dust created by the rewards algorithm - the issue raised at #4372. To see this, note that the dust left at the MASP address after all shielded tokens are unshielded in https://github.com/anoma/namada/pull/4285/files#diff-78668f42dcc983dea532ff370112f41796cfae99510ea10156df37c4e1e4e0d2R2287 has gone down from
nam: 0.003216
tonam: 0
.Checklist before merging
breaking::
labelsnamada-docs
reponamada-indexer
ornamada-masp-indexer
, a corresponding PR is opened in that repo