Protobuf Documentation
Purpose
This module is designed to calculate an inflation rewards each years based on static params. Each block rewards is the same over the year.
🧮 Calculation
The initial inflation is set to 15%, annual_provisions
and target_supply
will set at the beginning of the chain (on the first block).
It's based on the initial total supply. For example, with a total supply of 200M token, annual_provisions will be configured to 30M and target_supply 230M.
At the end of the year (the last block of the year, to be more precise), due to rounding imprecision, if the distributed
tokens for the last block of the year added with the actual tokens total supply is bigger than the target_supply
,
only the difference to reach the target_supply
will be minted. Conversely, in some case, due to rounding also,
the target_supply
is not reached at the last block, but at the next block.
The new inflation, annual_provisions
and target_supply
is recalculated at the next block after the block that
reach the target_supply
. To calculate the new inflation, get the current inflation multiplied by (1 - annual_reduction_factor
),
then the new annual_provisions
and target_supply
is deducted based on the current total supply (that is the old target_supply
)
Table of Contents
- mint/v1beta1/mint.proto
- mint/v1beta1/genesis.proto
- mint/v1beta1/query.proto
- mint/v1beta1/tx.proto
- Scalar Value Types
mint/v1beta1/mint.proto
Minter
Minter represents the minting state.
At the beginning of the chain (first block) the mint module will recalculate the annual_provisions
and
target_supply
based on the genesis total token supply and the inflation configured.
By default inflation is set to 15%. If the genesis total token supply is 200M token, the annual_provision
will be 30M
and target_supply
230M.
Field | Type | Label | Description |
---|---|---|---|
inflation | string | current annual inflation rate | |
annual_provisions | string | current annual expected provisions | |
target_supply | string | target supply at end of period |
Params
Params holds parameters for the mint module.
Configure the annual reduction factor will update at the each end of year the new token distribution rate by reducing
the actual inflation by the annual_reduction_factor
configured.
By default, annual_reduction_factor
is 20%. For example, with an initial inflation of 15%, at the end of the year,
new inflation will be 12%.
Field | Type | Label | Description |
---|---|---|---|
mint_denom | string | type of coin to mint | |
annual_reduction_factor | string | annual reduction factor inflation rate change | |
blocks_per_year | uint64 | expected blocks per year |
mint/v1beta1/genesis.proto
GenesisState
GenesisState defines the mint module's genesis state.
Field | Type | Label | Description |
---|---|---|---|
minter | Minter | minter is a space for holding current inflation information. | |
params | Params | params defines all the parameters of the module. |
mint/v1beta1/query.proto
QueryAnnualProvisionsRequest
QueryAnnualProvisionsRequest is the request type for the Query/AnnualProvisions RPC method.
QueryAnnualProvisionsResponse
QueryAnnualProvisionsResponse is the response type for the Query/AnnualProvisions RPC method.
Field | Type | Label | Description |
---|---|---|---|
annual_provisions | bytes | annual_provisions is the current minting annual provisions value. |
QueryInflationRequest
QueryInflationRequest is the request type for the Query/Inflation RPC method.
QueryInflationResponse
QueryInflationResponse is the response type for the Query/Inflation RPC method.
Field | Type | Label | Description |
---|---|---|---|
inflation | bytes | inflation is the current minting inflation value. |
QueryParamsRequest
QueryParamsRequest is the request type for the Query/Params RPC method.
QueryParamsResponse
QueryParamsResponse is the response type for the Query/Params RPC method.
Field | Type | Label | Description |
---|---|---|---|
params | Params | params defines the parameters of the module. |
Query
Query provides defines the gRPC querier service.
Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
---|---|---|---|---|---|
Params | QueryParamsRequest | QueryParamsResponse | Params returns the total set of minting parameters. | GET | /cosmos/mint/v1beta1/params |
Inflation | QueryInflationRequest | QueryInflationResponse | Inflation returns the current minting inflation value. | GET | /cosmos/mint/v1beta1/inflation |
AnnualProvisions | QueryAnnualProvisionsRequest | QueryAnnualProvisionsResponse | AnnualProvisions current minting annual provisions value. | GET | /cosmos/mint/v1beta1/annual_provisions |
mint/v1beta1/tx.proto
MsgUpdateParams
MsgUpdateParams is the Msg/UpdateParams request type.
Since: cosmos-sdk 0.47
Field | Type | Label | Description |
---|---|---|---|
authority | string | authority is the address that controls the module (defaults to x/gov unless overwritten). | |
params | Params | params defines the x/mint parameters to update. |
NOTE: All parameters must be supplied. |
MsgUpdateParamsResponse
MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.
Since: cosmos-sdk 0.47
Msg
Msg defines the x/mint Msg service.
Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
---|---|---|---|---|---|
UpdateParams | MsgUpdateParams | MsgUpdateParamsResponse | UpdateParams defines a governance operation for updating the x/mint module parameters. The authority is defaults to the x/gov module account. |
Since: cosmos-sdk 0.47 | |