Skip to content

Commit

Permalink
Merge PR #3894: Minting mechanism explanatory docs
Browse files Browse the repository at this point in the history
* minting spec concepts

* cl

* Update docs/spec/mint/01_concepts.md

Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com>

* typo address @alexanderbez

* Apply suggestions from code review

Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com>

* commit for CI to restart
  • Loading branch information
rigelrozanski authored Mar 18, 2019
1 parent 6ce4d5e commit ea9aecd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions .pending/improvements/sdk/3752-Explanatory-doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\#3752 Explanatory docs for minting mechanism (`docs/spec/mint/01_concepts.md`)
22 changes: 22 additions & 0 deletions docs/spec/mint/01_concepts.md
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions x/mint/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ea9aecd

Please sign in to comment.