core
core copied to clipboard
Reduce the maximum supply cap by a percentage determined by governance
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
- [ ] Github issue OR spec proposal link
- [ ] Wrote tests
- [ ] Updated API documentation (client/lcd/swagger-ui/swagger.yaml)
- [ ] Added a relevant changelog entry: clog add [section] [stanza] [message]
(FOR ADMIN) Before merging
- [ ] Added appropriate labels to PR
- [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
- [ ] Confirm added tests are consistent with the intended behavior of changes
- [ ] Ensure all tests pass
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 Good evening, I sent you a DM, on discord
@alchemist-ti please look at this one
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 Maximum value of supply(MS) 1,000,000 Percentage(P) 0.3 (30%) Exchange value LUNC-USTC(VT) 100,000 X = MS — (VT * P) X = 970,000 Values updated after exchange TS = 900,000 MS = 970,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.
https://medium.com/@igorsoares_41904/reduce-the-maximum-supply-cap-by-a-percentage-determined-by-governance-951695ca37bc
@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.
@igorv43Eu vejo. Você já considerou a questão dos preços do swap pool serem diferentes dos preços do oráculo se a oferta for limitada?
@igorv43 I see. Have you considered the issue of swap pool prices being different from oracle prices if supply is limited?
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
thank you for your efforts. unfortunately this branch is completely out of sync - maybe try to rebase your changes on current branch.