Module Mavryk_raw_protocol_alpha.Issuance_bonus_repr

Issuance bonus.

The issuance bonus is a rational but is stored as fixed point integer to limit the serialized size as with Q we would have no control on the size each component (numerator, denominator).

It is expected to always be between 0 and the protocol's parametric constant max_bonus. The int64 encoding of the bonus is made such that the approximation resulting of this encoding is negligible when the bonus is used in a context where the total supply of the network is in the order of magnitude of 2^50 mumav (10^15 mumav)

An issuance bonus is a rational between zero and some max_bonus.

type max_bonus = private t

A max_bonus is a value between zero and one.

val zero : t

Getting a bonus out of rational. It will fail if the decoding doesn't provide a value that is valid wrt protocol's parametric constants

val max_bonus_parameter_of_Q_exn : Mavryk_protocol_environment_alpha.Q.t -> max_bonus

Use only to define the max_bonus parameter from Default_parameters.