From ea9aecdff47d535be55f6a91097efb1432c65f9f Mon Sep 17 00:00:00 2001 From: frog power 4000 Date: Mon, 18 Mar 2019 11:11:31 -0400 Subject: [PATCH] Merge PR #3894: Minting mechanism explanatory docs * minting spec concepts * cl * Update docs/spec/mint/01_concepts.md Co-Authored-By: rigelrozanski * typo address @alexanderbez * Apply suggestions from code review Co-Authored-By: rigelrozanski * commit for CI to restart --- .../improvements/sdk/3752-Explanatory-doc | 1 + docs/spec/mint/01_concepts.md | 22 +++++++++++++++++++ docs/spec/mint/{01_state.md => 02_state.md} | 0 .../{02_begin_block.md => 03_begin_block.md} | 0 x/mint/minter.go | 4 ++-- 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .pending/improvements/sdk/3752-Explanatory-doc create mode 100644 docs/spec/mint/01_concepts.md rename docs/spec/mint/{01_state.md => 02_state.md} (100%) rename docs/spec/mint/{02_begin_block.md => 03_begin_block.md} (100%) diff --git a/.pending/improvements/sdk/3752-Explanatory-doc b/.pending/improvements/sdk/3752-Explanatory-doc new file mode 100644 index 000000000..1179bf065 --- /dev/null +++ b/.pending/improvements/sdk/3752-Explanatory-doc @@ -0,0 +1 @@ +\#3752 Explanatory docs for minting mechanism (`docs/spec/mint/01_concepts.md`) diff --git a/docs/spec/mint/01_concepts.md b/docs/spec/mint/01_concepts.md new file mode 100644 index 000000000..14b2c6abd --- /dev/null +++ b/docs/spec/mint/01_concepts.md @@ -0,0 +1,22 @@ +# Concepts + +## The Minting Mechanism + +The minting mechanism was designed to: + - allow for a flexible inflation rate determined by market demand targeting a particular bonded-stake ratio + - effect a balance between market liquidity and staked supply + +In order to best determine the appropriate market rate for inflation rewards, a +moving change rate is used. The moving change rate mechanism ensures that if +the % bonded is either over or under the goal %-bonded, the inflation rate will +adjust to further incentivize or disincentivize being bonded, respectively. Setting the goal +%-bonded at less than 100% encourages the network to maintain some non-staked tokens +which should help provide some liquidity. + +It can be broken down in the following way: + - If the inflation rate is below the goal %-bonded the inflation rate will + increase until a maximum value is reached + - If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation + rate will stay constant + - If the inflation rate is above the goal %-bonded the inflation rate will + decrease until a minimum value is reached diff --git a/docs/spec/mint/01_state.md b/docs/spec/mint/02_state.md similarity index 100% rename from docs/spec/mint/01_state.md rename to docs/spec/mint/02_state.md diff --git a/docs/spec/mint/02_begin_block.md b/docs/spec/mint/03_begin_block.md similarity index 100% rename from docs/spec/mint/02_begin_block.md rename to docs/spec/mint/03_begin_block.md diff --git a/x/mint/minter.go b/x/mint/minter.go index 761d9d1e6..a28e8f447 100644 --- a/x/mint/minter.go +++ b/x/mint/minter.go @@ -61,8 +61,8 @@ func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) ( Mul(params.InflationRateChange) inflationRateChange := inflationRateChangePerYear.Quo(sdk.NewDec(int64(params.BlocksPerYear))) - // increase the new annual inflation for this next cycle - inflation = m.Inflation.Add(inflationRateChange) + // adjust the new annual inflation for this next cycle + inflation = m.Inflation.Add(inflationRateChange) // note inflationRateChange may be negative if inflation.GT(params.InflationMax) { inflation = params.InflationMax }