Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Bet module parameter types and definition.
The Mint module employs two types of parameters-
Genesis parameters
Minter parameters
These parameters determine the inflation curve of the SGE Network chain over the lifetime of the chain. These parameters define the basic configuration of the chain. These parameters can be modified only via governance.
blocks_per_year
: This parameter determines the average number of blocks that will be generated over a year. In the above example, every 51840 block will be considered as 1 year.
mint_denom
: This value represents the coin denomination of the minted coins
phases
: This is an array of phase durations and their corresponding inflation rates. A detailed explanation of the Phases can be found in the concepts section.
exclude_amount
: By default, inflation is calculated over the total supply of coins. This parameter is used to exclude some amount of tokens before calculating the inflation amount. This is in accordance with Token Economics.
Minter is an entity that holds the fields required for the functioning of the minting mechanism. These parameters are used to store the current state of the minter. The minter parameters are automatically calculated during the operation of the chain. These can't be influenced directly via governance.
phase_provision
: This value calculates how many tokens are to be minted in the current phase. The value is recalculated at the end of every phase.
inflation
: This parameter defines the inflation rate for the current phase.
phase_step
: This parameter determines which phase the minter is in currently.
truncated_tokens
: The block provision equals the current annual provision divided by the number of blocks per year, the result needs to be converted to sdk.Int
as it is used in the MintCoins method of the bank module of blockchain. So the decimal part of the value will be truncated from the actual value, so we store truncated values in the minter and add this value to the annual provision in the next block.
The mint module is responsible for calculating and minting SGE tokens that will be distributed among validators as block rewards. The SGE mint module implements the concept of phases which defines the inflation curve of the SGE Network chain over its lifetime. Refer to the Token Economics section to know more about the inflation curve.
This section specifies the queries, transactions, and required payloads. By following this section, one can get a deep understanding of the functioning of the mint
module in the SGE Network chain.
The Mint module is responsible for minting tokens to reward validators and delegators for helping secure the chain. The Mint module is responsible for the inflation in the chain.
Unlike the default Mint Module of the Cosmos, which can vary the inflation rate dynamically based on the ratio of the bonded and the unbonded tokens at any point in time, the Mint module of the SGE Network chain follows a strict regime of inflation rates defined by the phases.
Phases are nothing but specific discreet time frames during which a certain inflation rate holds for the chain. Phases have two components:
duration
: The duration is defined as the year_coefficient. It defines the time in years for which a phase will hold. For example, a year_coefficient of 0.75 means that the phase will last for 9 months, that is, 3/4th of a year.
inflation
: This parameter defines the inflation rate of the chain for the phase in question. Inflation is defined as a decimal. That is inflation of 0.10000 means an inflation rate of 10%.
The duration and inflation rate of phases can be modified via governance. For more details about phases, visit phases.
If all the specified phases are over, the chain enters a special phase called the
final_phase
, where the phase duration is infinite and the phase inflation is zero. Note that the inflation rate does not depend on the number of bonded and unbonded tokens
The Minter message is used to store the data of the current inflation in the blockchain. The Minter entity consists of the following fields:
inflation
: current inflation rate of the chain.
phase_step
: Phase of inflation that the chain is working with.
phase_provisions
: Expected provisions of the current phase.
truncated_tokens
: Holds the truncated value of the mint calculations of the phases.
The proto for the Order Book messages is as follows:
The Phase message is used to store the data of a particular phase in the parameters in the blockchain. The Phase entity consists of the following fields:
inflation
: The inflation rate of the phase.
year_ocefficient
: The coefficient of a year (ex. 0.75 == 9 months).
Adding automatic execution of certain logic at the beginning of each block is being done in the Mint Module. The section elaborates on all the begin-blocker executions in the Mint module. Minting parameters are recalculated and inflation is paid at the beginning of each block.
Checking if the chain has moved from one phase to another, including the final phase, and re-setting the minter in case the phase has changed, is a begin-blocker operation implemented in the Mint module. It is implemented as follows:
If the phase has changed, set the minter with the changed parameters:
Since the SGE Network chain is predominantly reliant on phases for its inflation model, the phase_provision keeps track of the total amount of tokens to be distributed in the current phase. This value is calculated every time there is a phase change.
Calculate the provisions generated for each block based on the current phase provisions. The provisions are then minted by the mint module's ModuleMinterAccount and then transferred to the auth's FeeCollector ModuleAccount.