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

Integrate Inflation Model with MASP Burn and Mint #303

Closed
Tracked by #2020
murisi opened this issue Aug 9, 2022 · 4 comments
Closed
Tracked by #2020

Integrate Inflation Model with MASP Burn and Mint #303

murisi opened this issue Aug 9, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request ledger MASP

Comments

@murisi
Copy link
Collaborator

murisi commented Aug 9, 2022

MASP burn and mint currently distributes rewards to stakeholders that are a constant proportion of their asset holdings. These constant proportions are given in a function called masp_rewards in shared/src/types/address.rs. We now need to distribute rewards in accordance with the formulas in: https://github.com/anoma/specs/blob/9f30359d39f77487e02ea021c9815785026c1d1b/src/architecture/economics/inflation-system.md . Modifying masp_rewards to return computed proportions instead of constants might be one way to achieve this.

If the masp_rewards function is modified to achieve this goal, then note that for a given asset type its denominator must not change otherwise certain values in the rewards computations won't cancel properly. Also note that the current code assumes that the reward for an interval is the sum of the rewards of its parts and that historical reward conversions won't be changed in future.

@murisi murisi added enhancement New feature or request ledger MASP namada labels Aug 9, 2022
@murisi murisi added this to Namada-Old Aug 9, 2022
@murisi murisi moved this to Todo in Namada-Old Aug 9, 2022
@cwgoes cwgoes assigned mariari and unassigned Scar26 Jan 11, 2023
@cwgoes
Copy link
Collaborator

cwgoes commented Jan 13, 2023

@mariari I think you're doing this already?

@mariari
Copy link
Member

mariari commented Jan 16, 2023

@mariari I think you're doing this already?

Yes I'm handling it in the https://github.com/anoma/namada/tree/mariari/inflation-rewards branch

It's based on the work by @brentstone in #714

@cwgoes
Copy link
Collaborator

cwgoes commented Jan 17, 2023

If the masp_rewards function is modified to achieve this goal, then note that for a given asset type its denominator must not change otherwise certain values in the rewards computations won't cancel properly. Also note that the current code assumes that the reward for an interval is the sum of the rewards of its parts and that historical reward conversions won't be changed in future.

OK; then we should use a very high denominator, so that we can start with a high numerator and decrease it in the case of reward rates decreasing. We should pick a fixed range of ratios which we can cover with a specific fixed denominator.

Historical reward conversions will not be changed in the future, and the reward for an interval is indeed the sum of the rewards of its parts (the only thing the PD controller changes anyways is the current reward rate).

@murisi
Copy link
Collaborator Author

murisi commented Jan 22, 2023

@cwgoes Exactly - relatively high denominators will work. Note also that we can only give rewards when the client owns a quantity of an asset that exceeds the denominator (because AllowedConversions are more like ratios than fractions). So we must not make the denominator so large that a client cannot get rewarded for owning non-large quantities of assets. I do not believe this will be a problem in practice because we internally use micro-units: 2BTC is stored internally as 2*(10^6).

@cwgoes cwgoes closed this as completed Feb 5, 2024
@github-project-automation github-project-automation bot moved this from Todo to Tested in Devnet in Namada-Old Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ledger MASP
Projects
No open projects
Status: Tested in Devnet
Development

No branches or pull requests

4 participants