Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Minting mechanism explanatory docs #3894

Merged
merged 7 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`)
23 changes: 23 additions & 0 deletions docs/spec/mint/01_concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Concepts

## The Minting Mechanism

The minting mechanism was designed to:
- allow for a market evaluation of the inflation rate
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved
- optimize between market liquidity and staked supply.
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved

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 of under the goal %-bonded, the inflation rate will
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved
adjust to further incentivize or incentive being bonded. Setting the goal
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved
%-bonded at less than 100% encourages the network to maintain some non-staked tokens
which presumably encourages liquidity.
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved

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 cap is reached
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved
- 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 cap is reached
rigelrozanski marked this conversation as resolved.
Show resolved Hide resolved

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