Inflation system

Inflation system

The Namada protocol controls the Namada token NAM (the native staking token), which is programmatically minted to pay for algorithmically measurable public goods - proof-of-stake security and shielded pool usage - and out-of-band public goods. Proof-of-stake rewards are paid into the reward distribution mechanism in order to distribute them to validators and delegators. Shielded pool rewards are paid into the shielded pool reward mechanism, where users who kept tokens in the shielded pool can claim them asynchronously. Public goods funding is paid to the public goods distribution mechanism, which further splits funding between proactive and retroactive funding and into separate categories.

Proof-of-stake rewards

The security of the proof-of-stake voting power allocation mechanism used by Namada is dependent in part upon locking (bonding) tokens to validators, where these tokens can be slashed should the validators misbehave. Funds so locked are only able to be withdrawn after an unbonding period. In order to reward validators and delegators for locking their stake and participating in the consensus mechanism, Namada pays a variable amount of inflation to all delegators and validators. The amount of inflation paid is varied on a PD-controller in order to target a particular bonding ratio (fraction of the NAM token being locked in proof-of-stake). Namada targets a bonding ratio of 2/3, paying up to 10% inflation per annum to proof-of-stake rewards. See reward distribution mechanism for details.

Shielded pool rewards

Data protection provided by the MASP in practice depends on how many users use the shielded pool and what assets they use it with. To increase the likelihood of a sizeable shielded set, Namada pays a variable portion of inflation, up to 10% per annum, to shielded pool incentives, which are allocated on a per-asset basis by a PD-controller targeting specific amounts of each asset being locked in the shielded pool. See shielded pool incentives for details.

Detailed inflation calculation model

Inflation is calculated and paid per-epoch as follows.

First, we start with the following fixed (governance-alterable) parameters:

  • CapPoSCap_{PoS} is the cap of proof-of-stake reward rate, in units of percent per annum (genesis default: 10%)
  • CapSPACap_{SP_A} is the cap of shielded pool reward rate for each asset AA, in units of percent per annum
  • λPGF\lambda_{PGF} is the public goods funding reward rate, in units of percent per annum
  • RPoStargetR_{PoS-target} is the target staking ratio (genesis default: 2/3)
  • RSPAtargetR_{SP_A-target} is the target amount of asset AA locked in the shielded pool (separate value for each asset AA)
  • EpochsPerYearEpochsPerYear is the number of epochs per year (genesis default: 365)
  • KPPoSnom{KP}_{PoS-nom} is the nominal proportional gain of the proof-of-stake PD controller, as a fraction of the total input range
  • KDPoSnom{KD}_{PoS-nom} is the nominal derivative gain of the proof-of-stake PD controller, as a fraction of the total input range
  • KPSPAnom{KP}_{SP_A-nom} is the nominal proportional gain of the shielded pool reward controller for asset AA, as a fraction of the total input range (separate value for each asset AA)
  • KDSPAnom{KD}_{SP_A-nom} is the nominal derivative gain of the shielded pool reward controller for asset AA, as a fraction of the total input range (separate value for each asset AA)

Second, we take as input the following state values:

  • SNAMS_{NAM} is the current supply of NAM
  • LPoSL_{PoS} is the current amount of NAM locked in proof-of-stake
  • IPoSlastI_{PoS-last} is the proof-of-stake inflation amount from the previous epoch, in units of tokens per epoch
  • RPoSlastR_{PoS-last} is the proof-of-stake locked token ratio from the previous epoch
  • LSPAL_{SP_A} is the current amount of asset AA locked in the shielded pool (separate value for each asset AA)
  • ISPAlastI_{SP_A-last} is the shielded pool inflation amount for asset AA from the previous epoch, in units of tokens per epoch
  • RSPAlastR_{SP_A-last} is the shielded pool locked token ratio for asset AA from the previous epoch (separate value for each asset AA)

Public goods funding inflation can be calculated and paid immediately (in terms of total tokens per epoch):

  • IPGF=λPGFSNAM/EpochsPerYearI_{PGF} = \lambda_{PGF} * S_{NAM} / EpochsPerYear

These tokens (IPGFI_{PGF}) are distributed to the public goods funding validity predicate.

To run the PD-controllers for proof-of-stake and shielded pool rewards, we first calculate some intermediate values:

  • Calculate the latest staking ratio RPoSR_{PoS} as LPoS/SNAML_{PoS} / S_{NAM}
  • Calculate the per-epoch cap on the proof-of-stake and shielded pool token inflation
    • CapPoSEpoch=SNAMCapPoS/EpochsPerYearCap_{PoS-Epoch} = S_{NAM} * Cap_{PoS} / EpochsPerYear
    • CapSPAEpoch=SNAMCapSPA/EpochsPerYearCap_{SP_A-Epoch} = S_{NAM} * Cap_{SP_A} / EpochsPerYear (separate value for each AA)
  • Calculate PD-controller constants to be used for this epoch
    • KPPoS=KPPoSnomCapPoSEpoch{KP}_{PoS} = {KP}_{PoS-nom} * Cap_{PoS-Epoch}
    • KDPoS=KDPoSnomCapPoSEpoch{KD}_{PoS} = {KD}_{PoS-nom} * Cap_{PoS-Epoch}
    • KPSPA=KPSPAnomCapSPAEpoch{KP}_{SP_A} = {KP}_{SP_A-nom} * Cap_{SP_A-Epoch}
    • KDSPA=KDSPAnomCapSPAEpoch{KD}_{SP_A} = {KD}_{SP_A-nom} * Cap_{SP_A-Epoch}

Then, for proof-of-stake first, run the PD-controller:

  • Calculate the error EPoS=RPoStargetRPoSE_{PoS} = R_{PoS-target} - R_{PoS}
  • Calculate the error derivative EPoS=EPoSEPoSlast=RPoSlastRPoSE'_{PoS} = E_{PoS} - E_{PoS-last} = R_{PoS-last} - R_{PoS}
  • Calculate the control value CPoS=(KPPoSEPoS)(KDPoSEPoS)C_{PoS} = (KP_{PoS} * E_{PoS}) - (KD_{PoS} * E'_{PoS})
  • Calculate the new IPoS=max(0,min(IPoSlast+CPoS,CapPoSEpoch))I_{PoS} = max(0, min(I_{PoS-last} + C_{PoS}, Cap_{PoS-Epoch}))

These tokens (IPoSI_{PoS}) are distributed to the proof-of-stake reward distribution validity predicate.

Similarly, for each asset AA for which shielded pool rewards are being paid:

  • Calculate the error ESPA=RSPAtargetRSPAE_{SP_A} = R_{SP_A-target} - R_{SP_A}
  • Calculate the error derivative ESPA=ESPAESPAlast=RSPAlastRSPAE'_{SP_A} = E_{SP_A} - E_{SP_A-last} = R_{SP_A-last} - R_{SP_A}
  • Calculate the control value CSPA=(KPSPAESPA)(KDSPAESPA)C_{SP_A} = (KP_{SP_A} * E_{SP_A}) - (KD_{SP_A} * E'_{SP_A})
  • Calculate the new ISPA=max(0,min(ISPAlast+CSPA,CapSPAEpoch))I_{SP_A} = max(0, min(I_{SP_A-last} + C_{SP_A}, Cap_{SP_A-Epoch}))

These tokens (ISPAI_{SP_A}) are distributed to the shielded pool reward distribution validity predicate.

Finally, we store the latest inflation and locked token ratio values for the next epoch's controller round.