-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inflation)!: make inflation follow a polynomial distribution (#1670
) * feat: make inflation follow a polynomial distribution * chore: changelog * fix: fix inflation test * fix: fix epoch/period confusion
- Loading branch information
1 parent
c55185f
commit e2011cd
Showing
32 changed files
with
6,074 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
syntax = "proto3"; | ||
|
||
package nibiru.inflation.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "nibiru/inflation/v1/inflation.proto"; | ||
|
||
option go_package = "github.com/NibiruChain/nibiru/x/inflation/types"; | ||
|
||
// GenesisState defines the inflation module's genesis state. | ||
message GenesisState { | ||
// params defines all the parameters of the module. | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
// period is the amount of past periods, based on the epochs per period param | ||
uint64 period = 2; | ||
// skipped_epochs is the number of epochs that have passed while inflation is | ||
// disabled | ||
uint64 skipped_epochs = 3; | ||
} | ||
|
||
// Params holds parameters for the inflation module. | ||
message Params { | ||
// inflation_enabled is the parameter that enables inflation and halts | ||
// increasing the skipped_epochs | ||
bool inflation_enabled = 1; | ||
// polynomial_factors takes in the variables to calculate polynomial | ||
// inflation | ||
repeated string polynomial_factors = 2[ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
// inflation_distribution of the minted denom | ||
InflationDistribution inflation_distribution = 3 | ||
[ (gogoproto.nullable) = false ]; | ||
// epochs_per_period is the number of epochs that must pass before a new | ||
// period is created | ||
uint64 epochs_per_period = 4; | ||
|
||
// periods_per_year is the number of periods that occur in a year | ||
uint64 periods_per_year = 5; | ||
|
||
// max_period is the maximum number of periods that have inflation being | ||
// paid off. After this period, inflation will be disabled. | ||
uint64 max_period = 6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
package nibiru.inflation.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/NibiruChain/nibiru/x/inflation/types"; | ||
|
||
// InflationDistribution defines the distribution in which inflation is | ||
// allocated through minting on each epoch (staking, community, strategic). It | ||
// excludes the team vesting distribution. | ||
message InflationDistribution { | ||
// staking_rewards defines the proportion of the minted_denom that is | ||
// to be allocated as staking rewards | ||
string staking_rewards = 1 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
// community_pool defines the proportion of the minted_denom that is to | ||
// be allocated to the community pool | ||
string community_pool = 2 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
// strategic_reserves defines the proportion of the minted_denom that | ||
// is to be allocated to the strategic reserves module address | ||
string strategic_reserves = 3 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.