diff --git a/README.md b/README.md index 8757b84ef6..83ca4068d4 100644 --- a/README.md +++ b/README.md @@ -41,24 +41,24 @@ See [Release procedure](CONTRIBUTING.md#release-procedure) for more information ### Release Compatibility Matrix -| Umee Version | Mainnet | Cosmos SDK | IBC | Peggo | Price Feeder | Gravity Bridge | libwasmvm | -| :----------: | :-----: | :--------: | :----: | :-----: | :----------: | :------------------------: | :-------: | -| v0.8.x | ✗ | v0.45.x | v2.0.x | v0.2.x | v0.1.x | | | -| v1.x.x | ✓ | v0.45.x | v2.0.x | v0.2.x | N/A | umee/v1 module/v1.4.x-umee | | -| v2.x.x | ✗ | v0.45.x | v2.3.x | v0.2.x | v0.2.x | umee/v2 module/v1.4.x | | -| v3.0-1.x | ✓ | v0.46.x | v5.0.x | v1.3.x+ | v1.0.x | umee/v3 module/v1.5.x-umee | | -| v3.1.0-cw1 | ✗ | v0.46.x | v5.0.x | v1.3.x+ | v2.0.x | umee/v3 module/v1.5.x-umee | | -| v3.2.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.x | umee/v3 v1.5.3-umee-3 | v1.1.1 | -| v3.3.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.2 | umee/v3 v1.5.3-umee-3 | v1.1.1 | -| v4.0.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.3 | umee/v4 v1.5.3-umee-4 | v1.1.1 | -| v4.1.x | ✓ | v0.46.7+ | v5.2.x | v1.3.x+ | v2.1.0 | umee/v4 v1.5.3-umee-4 | v1.1.1 | -| v4.2.x | ✓ | v0.46.10+ | v5.2.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-4 | v1.1.1 | -| v4.3.x | ✓ | v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-6 | v1.2.1 | -| v4.4.x | ✓ | v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-6 | v1.2.3 | -| v5.0.x | ✓ | v0.46.13+ | v6.2.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-8 | v1.2.4 | -| v5.1.x | ✓ | v0.46.13+ | v6.2.x | --- | umee/v2.1.6+ | umee/v4 v1.5.3-umee-10 | v1.2.4 | -| v5.2.x | ✓ | v0.46.13+ | v6.2.x | --- | umee/v2.1.6+ | umee/v4 v1.5.3-umee-10 | v1.2.4 | -| v6.0.x | ✓ | v0.46.14+ | v6.2.x | --- | umee/v2.1.6+ | --- | v1.3.0 | +| Umee Version | Mainnet | Cosmos SDK | IBC | Peggo | Price Feeder | Gravity Bridge | libwasmvm | +| :----------: | :-----: | :--------: | :----: | :-----: | :------------: | :------------------------: | :-------: | +| v0.8.x | ✗ | v0.45.x | v2.0.x | v0.2.x | v0.1.x | | | +| v1.x.x | ✓ | v0.45.x | v2.0.x | v0.2.x | N/A | umee/v1 module/v1.4.x-umee | | +| v2.x.x | ✗ | v0.45.x | v2.3.x | v0.2.x | v0.2.x | umee/v2 module/v1.4.x | | +| v3.0-1.x | ✓ | v0.46.x | v5.0.x | v1.3.x+ | v1.0.x | umee/v3 module/v1.5.x-umee | | +| v3.1.0-cw1 | ✗ | v0.46.x | v5.0.x | v1.3.x+ | v2.0.x | umee/v3 module/v1.5.x-umee | | +| v3.2.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.x | umee/v3 v1.5.3-umee-3 | v1.1.1 | +| v3.3.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.2 | umee/v3 v1.5.3-umee-3 | v1.1.1 | +| v4.0.x | ✓ | v0.46.6+ | v5.1.x | v1.3.x+ | v2.0.3 | umee/v4 v1.5.3-umee-4 | v1.1.1 | +| v4.1.x | ✓ | v0.46.7+ | v5.2.x | v1.3.x+ | v2.1.0 | umee/v4 v1.5.3-umee-4 | v1.1.1 | +| v4.2.x | ✓ | v0.46.10+ | v5.2.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-4 | v1.1.1 | +| v4.3.x | ✓ | v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-6 | v1.2.1 | +| v4.4.x | ✓ | v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-6 | v1.2.3 | +| v5.0.x | ✓ | v0.46.13+ | v6.2.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-8 | v1.2.4 | +| v5.1.x | ✓ | v0.46.13+ | v6.2.x | --- | umee/v2.1.6+ | umee/v4 v1.5.3-umee-10 | v1.2.4 | +| v5.2.x | ✓ | v0.46.13+ | v6.2.x | --- | umee/v2.1.6+ | umee/v4 v1.5.3-umee-10 | v1.2.4 | +| v6.0.x | ✓ | v0.46.14+ | v6.2.x | --- | umee/v2.1.6-1+ | --- | v1.3.0 | #### Price Feeder diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5cccdac977..86c8e8acd5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -10,20 +10,25 @@ Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-proce Highlights: -- TODO +- TODO: special assets, new Gov messages +- New [inflation mechanism](./docs/design_docs/012-umee-inflation-v2.md). -[v6.0.0 CHANGELOG](https://github.com/umee-network/umee/blob/v6.0.0/CHANGELOG.md). +### New Inflation Mechanism -### Validators +The Upgrade Handler sets the following values to the Umee `x/ugov` Inflation Cycle parameters: + +- `max_supply = 21e18uumee` (21 billions UMEE) +- `inflation_cycle = time.Hour * 24 * 365 * 2` (2 years) +- `inflation_reduction_rate = 2500 basis points` (25%) -#### libwasmvm update +The new Inflation Cycle will start on 2023-10-15 15:00 UTC. This will mark the first inflation reduction from the current rates: -Our dependencies have been updated. Now the binary requires `libwasmvm v1.3.0`. When you build the binary from source on the server machine you probably don't need any change. However when you download a binary from GitHub, or from other source, make sure you update the `/usr/lib/libwasmvm..so`. For example: +- `inflation_min` 7% → 5.25% +- `inflation_max` 14% → 10.5% -- copy from `$GOPATH/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.3.0/internal/api/libwasmvm.$(uname -m).so` -- or download from github `wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.3.0/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so` +The x/staking Bonded Goal stays the same: 33.00%. -You don't need to do anything if you are using our Docker image. +### Validators #### Min Gas Prices diff --git a/docs/design_docs/012-umee-inflation-v2.md b/docs/design_docs/012-umee-inflation-v2.md new file mode 100644 index 0000000000..d4bf36f4c4 --- /dev/null +++ b/docs/design_docs/012-umee-inflation-v2.md @@ -0,0 +1,103 @@ +# Design Doc 12: UMEE Inflation v2 + +## Changelog + +- August, 2023: Initial Design (Ming Duan, @robert-zaremba) + +## Status + +Accepted + +## Abstract + +Umee v2 Inflation model introduces market cap for the UMEE supply and inflation cycles when the inflation is updated. + +## Context + +Today, the token issuance follows standard Cosmos SDK mechanism. We want to progressively limit the issuance in an algorithmic way. The UMEE tokenomics needs to be optimized with the following considerations: + +- The current network parameters - min inflation 7% max inflation 14% - results in high spending on chain security. +- The adoption of liquid staking will drive more staking with a lower staking yield required. +- Interchain security and chain based revenue streams can become additional source of income for stakers. +- Set the hard cap to influence more the market expectations of the Umee supply. + +## Specification + +We set the max inflation to 21 billion UMEE (the supply today is around 12.2 billions): + +- Block rewards are always adjusted (zeroed or reduced if necessary) so total supply never exceeds 21 billion UMEE. + - Supply is measured based on `bank/QueryTotalSupply`. +- Minting resumes if supply drops below 21B (and stops again once 21B is reached). +- Burn events will reduce the UMEE supply, enabling more staking rewards, according to the inflation rules. Burning events were included in the whitepaper, but the exact specification will be the subject of another design document. + +The $UMEE v2 Inflation follows a similar Cosmos dynamic inflation mechanism based on the bonding rate in the `x/staking` module, to allow the Umee chain to naturally adjust inflation rate to drive staking activities to reach the target bonding rate. + +On top of that we introduce _inflation cycle_, which is initially set to 2 years and controlled by the UMEE governance. In each inflation cycle, the yearly total amount of newly emitted tokens is a variable as per the `x/staking` Cosmos SDK module. +At the end of each inflation cycle, the `x/mint` module `inflation_min` and `inflation_max` parameters are automatically decreased by the `infaltion_reduction_rate` parameter, which is initially set to 25%. + +Finally, we accelerate the `x/mint` [inflation rate change](https://github.com/cosmos/cosmos-sdk/blob/v0.47.2/x/mint/README.md#nextinflationrate) speed from 1 year to **6 months**. + +Umee governance at any time can vote and modify the inflation schedule if the external environment changes materially and requires a different plan. + +### Technical Implementation + +The new inflation mechanism is build on top of the existing `x/mint` module by providing [`InflationCalculationFn`](https://github.com/cosmos/cosmos-sdk/blob/v0.46.14/x/mint/types/genesis.go#L12) to the `x/mint` module constructor. That function will use Umee `x/ugov` module which will control and store the following parameters: + +```protobuf +message InflationParams { + // max_supply is the maximum supply. Inflation will not increase the UMEE supply above this value. + cosmos.base.v1beta1.Coin max_supply = 1; + + // inflation_cycle duration after which inflation rates are changed. + google.protobuf.Duration inflation_cycle = 2; + + // inflation_reduction_rate for every inflation cycle in basis points. + uint32 inflation_reduction_rate = 3; +} +``` + +The Umee `x/ugov` will be extended by the following Msg Server Message: + +```protobuf +message MsgGovUpdateInflationParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority must be the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + InflationParams params = 2; +} +``` + +The inflation cycle change is handled by the `InflationCalculationFn` function, implemented by the `inflation.Calculator` object (in the `app/inflation` package). The `Calculator` will handle the x/ugov module dependency. + +## Alternative Approaches + +We were discussing more advanced mechanism, which would define the staking rewards per user based on his usage of the `x/leverage` and `x/metoken` modules (notably amount of supplying assets). + +Another possible modification is to set a constant inflation rate during each Inflation Cycle. It would make the calculation simpler, and make the yearly new supply more predictable. However, it will remove the dynamic nature of the traditional `x/staking` which adapts the block rewards based on the UMEE staking target. + +## Test Case + +- Unit tests to verify the Inflation Cycle changes. +- Unit tests to verify the inflation change speed. +- Integration test to verify the x/staking and x/ugov integration. + +## Consequences + +- Umee supply is predictable. +- Umee sell pressure is reduced. +- Umee inflation is more dynamic. + +### Backwards Compatibility + +- The solution is backwards compatible with the existing Cosmos SDK stack. We don't need to fork any Cosmos SDK module implementation, nor overwrite it. +- The implementation adds new method to the UMEE `x/ugov` module and new parameter set, which is additive. + +## Further Discussions + +We are exploring the burn mechanisms and ways how to better react on the market conditions. + +## References + +- Cosmos SDK [x/mint documentation](https://github.com/cosmos/cosmos-sdk/blob/v0.47.2/x/mint/README.md) +- Osmosis [Thirdening](https://medium.com/@ne_fertiti/what-is-osmosis-thirdening-how-it-affects-your-lp-staking-returns-c750f89efb14) diff --git a/proto/umee/ugov/v1/ugov.proto b/proto/umee/ugov/v1/ugov.proto index 643f73ae1e..fd9cd46c94 100644 --- a/proto/umee/ugov/v1/ugov.proto +++ b/proto/umee/ugov/v1/ugov.proto @@ -10,7 +10,7 @@ option (gogoproto.goproto_getters_all) = false; // InflationParams params for changing the inflation min rate and max rate of mint module params. message InflationParams { - // max_supply is the maximum supply for liquidation. + // max_supply is the maximum supply. Inflation will not increase the UMEE supply above this value. cosmos.base.v1beta1.Coin max_supply = 1 [(gogoproto.nullable) = false]; // inflation_cycle duration after which inflation rates are changed. google.protobuf.Duration inflation_cycle = 2 [ @@ -19,9 +19,9 @@ message InflationParams { (gogoproto.jsontag) = "inflation_cycle,omitempty", (gogoproto.moretags) = "yaml:\"inflation_cycle\"" ]; - // inflation_reduction_rate for every inflation cycle. + // inflation_reduction_rate for every inflation cycle in basis points. uint32 inflation_reduction_rate = 3 [ (gogoproto.customtype) = "github.com/umee-network/umee/v6/util/bpmath.FixedBP", (gogoproto.nullable) = false ]; -} \ No newline at end of file +} diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index f56c31fb0b..dcd714d561 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -2417,7 +2417,9 @@ paths: type: object properties: max_supply: - description: max_supply is the maximum supply for liquidation. + description: >- + max_supply is the maximum supply. Inflation will not + increase the UMEE supply above this value. type: object properties: denom: @@ -2432,7 +2434,9 @@ paths: inflation_reduction_rate: type: integer format: int64 - description: inflation_reduction_rate for every inflation cycle. + description: >- + inflation_reduction_rate for every inflation cycle in + basis points. description: >- InflationParams params for changing the inflation min rate and max rate of mint module params. @@ -6143,7 +6147,9 @@ definitions: type: object properties: max_supply: - description: max_supply is the maximum supply for liquidation. + description: >- + max_supply is the maximum supply. Inflation will not increase the UMEE + supply above this value. type: object properties: denom: @@ -6156,7 +6162,7 @@ definitions: inflation_reduction_rate: type: integer format: int64 - description: inflation_reduction_rate for every inflation cycle. + description: inflation_reduction_rate for every inflation cycle in basis points. description: >- InflationParams params for changing the inflation min rate and max rate of mint module params. @@ -6180,7 +6186,9 @@ definitions: type: object properties: max_supply: - description: max_supply is the maximum supply for liquidation. + description: >- + max_supply is the maximum supply. Inflation will not increase the + UMEE supply above this value. type: object properties: denom: @@ -6193,7 +6201,9 @@ definitions: inflation_reduction_rate: type: integer format: int64 - description: inflation_reduction_rate for every inflation cycle. + description: >- + inflation_reduction_rate for every inflation cycle in basis + points. description: >- InflationParams params for changing the inflation min rate and max rate of mint module params. diff --git a/x/ugov/inflation_params.go b/x/ugov/inflation_params.go index 26626b92b5..34eb057ccc 100644 --- a/x/ugov/inflation_params.go +++ b/x/ugov/inflation_params.go @@ -12,9 +12,9 @@ import ( func DefaultInflationParams() InflationParams { return InflationParams{ - MaxSupply: coin.New(appparams.BondDenom, 21_000000000_000000), // 21 Billion Maximum - InflationCycle: time.Hour * 24 * 365 * 2, // 2 years for default inflation cycle - InflationReductionRate: bpmath.FixedBP(2500), // 25% reduction rate for inflation cyle + MaxSupply: coin.New(appparams.BondDenom, 21_000_000_000_000000), // 21 Billion Maximum + InflationCycle: time.Hour * 24 * 365 * 2, // 2 years for default inflation cycle + InflationReductionRate: bpmath.FixedBP(2500), // 25% reduction rate for inflation cyle } } @@ -26,7 +26,7 @@ func (ip InflationParams) Validate() error { } if ip.InflationReductionRate > bpmath.One || ip.InflationReductionRate < 100 { - return sdkerrors.ErrInvalidRequest.Wrap("inflation reduction must be between 100bp to 10'000bp") + return sdkerrors.ErrInvalidRequest.Wrap("inflation reduction must be between 100bp and 10'000bp") } if ip.InflationCycle.Seconds() <= 0 { diff --git a/x/ugov/msg_test.go b/x/ugov/msg_test.go index 02ca5e1b75..0acc1d85dd 100644 --- a/x/ugov/msg_test.go +++ b/x/ugov/msg_test.go @@ -97,7 +97,7 @@ func TestMsgGovUpdateInflationParams(t *testing.T) { msg.Authority = "umee1yesmdu06f7strl67kjvg2w7t5kacc" assert.ErrorIs(t, msg.ValidateBasic(), govtypes.ErrInvalidSigner, "must fail on a non gov account") msg.Params.InflationReductionRate = bpmath.FixedBP(10) - assert.ErrorContains(t, msg.Params.Validate(), "inflation reduction must be between 100bp to 10'000bp") + assert.ErrorContains(t, msg.Params.Validate(), "inflation reduction must be between 100bp and 10'000bp") msg.Params.MaxSupply = coin.Negative1("test") assert.ErrorContains(t, msg.Params.Validate(), "max_supply must be positive") } diff --git a/x/ugov/ugov.pb.go b/x/ugov/ugov.pb.go index ea0ffd661b..d1acead70a 100644 --- a/x/ugov/ugov.pb.go +++ b/x/ugov/ugov.pb.go @@ -31,11 +31,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // InflationParams params for changing the inflation min rate and max rate of mint module params. type InflationParams struct { - // max_supply is the maximum supply for liquidation. + // max_supply is the maximum supply. Inflation will not increase the UMEE supply above this value. MaxSupply types.Coin `protobuf:"bytes,1,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply"` // inflation_cycle duration after which inflation rates are changed. InflationCycle time.Duration `protobuf:"bytes,2,opt,name=inflation_cycle,json=inflationCycle,proto3,stdduration" json:"inflation_cycle,omitempty" yaml:"inflation_cycle"` - // inflation_reduction_rate for every inflation cycle. + // inflation_reduction_rate for every inflation cycle in basis points. InflationReductionRate github_com_umee_network_umee_v6_util_bpmath.FixedBP `protobuf:"varint,3,opt,name=inflation_reduction_rate,json=inflationReductionRate,proto3,customtype=github.com/umee-network/umee/v6/util/bpmath.FixedBP" json:"inflation_reduction_rate"` }