Core Functionality
Staking
The staking process allows users to convert their MAT tokens into liquid stMAT while delegating the underlying MAT to the staking infrastructure for rewards accrual.

The user deposits MAT into the
LiquidStakingPool
contract.The contract calculates the current exchange rate between MAT and stMAT.
The user receives stMAT tokens based on the calculated exchange rate.
The protocol delegates the deposited MAT to the designated
StakingPool
.
Rewards Accrual
The protocol accrues staking rewards over time and reflects them through an increasing MAT-to-stMAT exchange rate.
StakingPool
accrues rewards through participation in MAT token generation.The protocol tracks increases in the MAT balance within the
LiquidStakingPool
.A portion of the newly accrued rewards is collected as protocol fees.
The exchange rate between MAT and stMAT increases, reflecting the growth in total MAT backing stMAT supply.
As the exchange rate rises, all stMAT holders benefit proportionally — their token balances remain fixed, but redeemable value increases.
Standard Unstaking (7-days unbonding)
The standard unstaking process allows users to redeem MAT by burning stMAT, subject to a fixed unbonding period.

The user burns stMAT tokens by calling
requestUnstake()
.The contract calculates the equivalent MAT amount based on the current exchange rate.
The protocol initiates unstaking from the
StakingPool
.A 7-day unbonding period begins (equivalent to 1,209,600 blocks).
After the unbonding period, the user can claim their unstaked MAT tokens.
Flash Unstaking (Immediate)
Flash unstaking allows users to bypass the unbonding period and receive MAT instantly by leveraging a dedicated flash liquidity pool.
The user burns stMAT tokens by calling flashUnstake().
The contract calculates the equivalent MAT amount based on the current exchange rate.
The user receives MAT immediately, minus a flash unstake fee, which is a fixed percentage deducted from the withdrawal amount, and configurable by the protocol owner.
The original unstaking process continues in the background to restore liquidity.
After the 7-day unbonding period, the flash pool is automatically replenished.
Pool Migration
The protocol supports migration between staking pools, allowing the operator to reassign delegated MAT without impacting user balances or the exchange rate.
The owner initiates migration by calling
changeStakingPool()
.The protocol unstakes all MAT from the currently assigned
StakingPool
.After the 7-day unbonding period completes, the owner calls
completeMigration()
.The unstaked funds are restaked to the new
StakingPool
.Throughout the process, the exchange rate and user positions remain unaffected.
Last updated