-
Notifications
You must be signed in to change notification settings - Fork 51
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
Reduce the maximum supply cap by a percentage determined by governance #315
base: main
Are you sure you want to change the base?
Conversation
Authored-by: igor veras <[email protected]>
hi, thanks you for submitting the code, can you clear out all the conflicts first |
please fix test as well |
@igorv43 can we have a talk, I would love to talk to you |
@nghuyenthevinh2000 |
@alchemist-ti please look at this one |
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.
It seems to only limit the max supply, I don't understand how to reduce it.
The reduction takes place on exchange. Total value of supply(TS) 1,000,000 So I write it to the SetSupplyMaxDescending(MS) storage. Every change I consult getSupplyMaxDescending and check the limit if it is less than or equal to MS, let it change. |
@igorv43 I see. Have you considered the issue of swap pool prices being different from oracle prices if supply is limited? |
@igorv43 Parameters need to be initialized in the upgrade handler, you can refer to https://github.com/classic-terra/core/tree/main/app/upgrades. |
|
I hadn't taken into account, and I was unaware that the price could fluctuate. I had assumed they would calculate the market value. How can I check the current price? |
Sorry, I closed it by mistake |
Summary of changes
Good morning!
Guys, I'm sending a code that reduces the supply safely if you open the markt swap.
Everything is explained in the link below:
https://medium.com/@igorsoares_41904/reduce-the-maximum-supply-cap-by-a-percentage-determined-by-governance-951695ca37bc
If possible, please test.
Attention needs to be deployed also on the burn rate, because if you have burn rate, you need to reduce the total maximum supply. But do not add the calculation with a percentage, but subtract the value burned by the maximum supply limit. it would be something like this:
amount:= burnTax
supplyMaxDescending := k.GetSupplyMaxDescending(ctx, []byte("SupplyMaxDescending"+offerCoin.Denom))
k.SetSupplyMaxDescending(ctx, []byte("SupplyMaxDescending"+offerCoin.Denom), supplyMaxDescending.Sub(amount.TruncateInt()))
Report of required housekeeping
(FOR ADMIN) Before merging