Params

Bet module parameter types and definition.

The Mint module employs two types of parameters-

  1. Genesis parameters

  2. Minter parameters

Genesis 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.

"params": {
    "blocks_per_year": "51840",
    "mint_denom": "usge",
    "phases": [
        {
        "inflation": "0",
        "year_coefficient": "3"
        }
    ],
    "exclude_amount": "445000000000025"
}
  • 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 Parameters

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.

"minter": {
    "phase_provisions": "100000000000000.000000000000000000",
    "inflation": "0.1",
    "phase_step": "1",
    "truncated_tokens": "0.000000000000000000"
},
  • 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.

// BlockProvisions returns the provisions for a block based on the phase
// provisions rate.
func (m Minter) BlockProvisions(params Params, phaseStep int) (sdk.Coin, sdk.Dec) {
	// get total blocks in this phase
	blocksPerPhase := params.getPhaseBlocks(phaseStep).TruncateDec()
	// detect each block provisions then and the truncated value from previous block
	provisionAmt := m.PhaseProvisions.Quo(blocksPerPhase).Add(m.TruncatedTokens)
	// extract the integer and decimal part of provisions
	// the decimal part is the truncated value because of conversion to sdk.Int
	// so the decimal part is truncated and needs to be added in next block
	intPart := provisionAmt.TruncateDec()
	decPart := provisionAmt.Sub(intPart)
	return sdk.NewCoin(params.MintDenom, intPart.TruncateInt()), decPart
}

Last updated