-
Notifications
You must be signed in to change notification settings - Fork 7
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
change reserve emissions config from percent rate to weights #28
change reserve emissions config from percent rate to weights #28
Conversation
👋 Thanks for the PR! This is a good point about asset disabling, that could make this change worth while. The original design was done this way instead of shares due to clarity and rounding concerns. With shares, each "share" ends up getting rounded down, then the amount of tokens is rounded down again, rather than the shares being exact. This might not make much of an impact to actual emissions numbers, tho. I'll look into it and get back here! |
Thanks for your reply. Regarding the rounding-down impact, I have a solution. Do you think this can be accepted? The idea is to add the remaining emissions caused by rounding to a random emission element. Additionally, the disabled asset can be filtered out in the first for-loop by adding some extra code. Best regards |
Got time to look into how impactful rounding down can be if we opt use weights, and the impact is pretty minimal. With extremely unoptimized weights (say, emitting to 10 different assets and all 10 get rounded down) this means about 0.0001% of emissions are lost to rounding. This could also easily be fixed by the pool creator by adjusting the weights, minimizing the impact even more. Thus, I think the simpler solution is a better solution here. My suggestions:
I think this change helps a lot when handling disabled assets, so would be happy to merge once the suggestions are addressed. Thanks for the contribution! |
This reverts commit 1ba3c1f.
…sions remove unit test test_set_pool_emissions_panics_if_over_100 add unut test test_set_pool_emissions_panics_if_anyone_share_equal_0
Hello @mootz, this is the modification based on your suggestion. Thanks! |
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.
LG2M!
Hello,
I noticed that the share in the emissions configuration is being used directly as a percentage rate. If the total share does not equal 1_0000000, some emissions may be lost when invoking the do_gulp_emissions function.
How about changing the share value from a percentage rate to a weight? This could help prevent emissions from being lost and make the emissions configuration easier to manage.
Additionally, when considering the asset disabling feature, I suggest ignoring the emissions that are sent to the disabled asset as well. With this change, it would be easier to disregard the share of the disabled asset and redistribute the remaining emissions to the other reserves.