Expand description

Proof of Stake Module

The goal of the Proof of Stake module is to reward people for providing liquidity to the Mangata DEX.

Types of Rewards

Native Rewards

As described in Mangata tokenomics, during each session, some of the rewards are minted and distributed among promoted pools. The council decides which pool to promote, and each promoted pool has a weight assigned that determines how much of the rewards should be distributed to that pool.

The final amount of tokens that a user receives depends on:

  • the amount of activated liquidity - rewards are distributed proportionally to the amount of activated liquidity.
  • the liquidity token itself - the more weight is assigned to the pool, the more rewards it receives.
  • the time of liquidity activation - the longer a user stores liquidity, the more rewards they receive (based on an asymptotic curve).

Activated Liquidity cannot be transferred to another account; it is considered locked. The moment liquidity is unlocked, the user loses the ability to claim rewards for that liquidity.

Storage entries
Extrinsics

3rd Party Rewards

Anyone can provide tokens to reward people who store a particular liquidity token. Any liquidity token can be rewarded with any other token provided by the user. Liquidity can be activated for multiple scheduled rewards related to that liquidity token. Tokens will remain locked (untransferable) as long as there is at least one schedule for which these rewards are activated.

Storage entries
Extrinsics

Reusing a Single Liquidity Token for Multiple Rewards

It may happen that a single liquidity token is rewarded with:

  • Liquidity Mining Rewards - because the pool was promoted by the council.
  • Scheduled rewards with token X - because Alice decided to do so.
  • Scheduled rewards with token Y - because Bob decided to do so.

In that case, a single liquidity token can be used to obtain rewards from multiple sources. There are several options to do that:

Unlocking tokens used for rewards

Once liquidity tokens are used to sign up for rewards they persist on user account but they become reserved/untransferable. In order to unlock them they need to be deactivated. Depending on rewards kind (native or 3rdparty) deactivation process differs.

Native rewards

3rdparty rewards

If liq tokens are used for 3rdparty rewards they are locked in the moment of activation. To get them unlocked you need to unlock all of them(liq tokens) for every 3rdparty rewards schedule/token they were used/activated. Even if you want to deactivate only part of it, all of them needs to be deactivated, afterwards they can be reactivated with no penalty in terms of recevied rewards (you will get same amount of rewards as you would not be deactivating them)

3rdparty Rewards

It may happen that a single liquidity token is rewarded with:

  • Liquidity Mining Rewards - because the pool was promoted by the council.
  • Scheduled rewards with token X - because Alice decided to do so.
  • Scheduled rewards with token Y - because Bob decided to do so.

In that case, a single liquidity token can be used to obtain rewards from multiple sources. There are several options to do that:

Re-exports

Modules

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
  • Autogenerated weights for pallet_proof_of_stake

Macros

Structs

Enums

Type Definitions