Comment on page
Staking Tokens (LP & sLP)
LP Tokens are given to Liquidity Providers when they add liquidity to mAsset-UST or MIR-UST Terraswap pools. Each pool has a unique LP token associated with it and cannot be combined with LP tokens from other pools. They serve primarily as a unit of account, representing the liquidity provider's share in the pool in order to reclaim assets when they remove liquidity.
Although LP tokens exist independently as a yield-generation feature of Terraswap, they are central to Mirror's market infrastructure. As such, the protocol provides MIR rewards to users who stake LP tokens as an incentive to help maintain liquid markets on Terraswap for mAssets and MIR.
There exists a different LP token for each mAsset-UST's Terraswap pool, as well as the MIR-UST pool. The descriptions below refer to each individual pool's supply of LP tokens.
A user can provide liquidity by depositing tokens to both sides of a Mirror-related Terraswap pool. This results in the creation of LP tokens for that pool, which they can use to retrieve assets from the pool.
For a new pool with starting quantities of UST and mAsset / MIR
, the number of LP tokens is:
Given quantities of UST and mAsset/MIR being deposited
, and currently in the pool prior to deposit
, and the current supply of LP tokens
, the amount of newly minted LP tokens is:
Although liquidity providers can deposit any amount for both tokens, they are incentivized to put in quantities where value is equal on both sides, taking into consideration the mAsset or MIR's market price. Doing otherwise would cause them to incur losses as it would create arbitrage opportunities against the pool, and the LP tokens they received would be insufficient for recover their liquidity.
It is very probable that the amounts of assets recovered by burning LP tokens will be different from the quantities deposited. This comes from a variety of reasons such as price movement of mAsset / MIR, changes in your relative share of the liquidity pool, etc.
A user can burn their LP tokens to recover their deposited liquidity. The pool will send back amounts of UST and mAssets (or MIR), depending on the amount of LP tokens they burn, determined by the formulas shown below.
Holders of LP tokens receive a portion of rewards generated by the pool's trading fees, divvied out in proportion to total share of LP token pool. A portion of either mAsset/MIR or UST (depending on the direction of the trade) gets added back into the pool as the LP Commission.
This functionality is not implemented in the Mirror Protocol contracts, and comes purely due to Terraswap's incentive structure for liquidity providers. Because the trading fee rewards are returned to the pool, they can only be withdrawn by burning LP tokens and withdrawing liquidity.
sLP Tokens are minted and immediately staked when a short position is created. Each mAsset has a unique sLP token associated with it and cannot be combined with sLP from other mAssets. When closing a short CDP, the same amount of both sLP and mAsset have to be burned in order to fully close the short position and withdraw all collateral. Note that sLP cannot be transferred or traded, and they are immediately staked after being minted and burned immediately after a position is closed.
A user can short an mAsset by providing collateral to mint contract. This results in the creation of sLP tokens, which can be burnt with the corresponding mAsset to retrieve the collateral.
The number of sLP minted is directly proportional to the quantity of mAssets minted and shorted from the position. A user will also receive the quantity of UST corresponding to the Terraswap value of the shorted mAsset after a governance-defined locking period. The locking period parameter in Mirror Lock contract and is changeable through governance poll voting.
In order to fully burn sLP tokens to withdraw all collateral, a user must have hold the amount of mAssets that were shorted when the short position was created.
When the position is closed, sLP token will be automatically unstaked, and be burnt with the mAsset against the short position to redeem all collateral. Note that short position is similar to the typical mint position, so a 1.5% protocol fee will also be charged on the amount of collateral being withdrawn.
If the whole position is closed, the minter immediately receives back locked UST. If the position is only partially closed, the UST received from the automatic sell-off of the minted mAsset is still subject to the total locking period.
Since minted mAssets are sold immediately after short position creation, amount of UST corresponding to the value of mAsset shorted against the Terraswap pool is returned to the user.
lock_periodis applied to the returned UST after a short position is created (set to 2 weeks at the launch of Mirror v2). User may choose to close their short position at any time by buying the shorted amount from Terraswap, but the UST from shorting might be within the
lock_period. To use the UST from shorting to close the position, user must wait until the lock period ends, and claim the corresponding amount.
This section discusses staking rewards for LP & sLP tokens, which come from the new MIR tokens minted per block by the protocol as inflation. Staking MIR also generates MIR rewards, which come from trading fees rather than inflation. Learn more about it here.
Mirror allows users to additionally profit from LP tokens by staking them to receive Mirror Token (MIR) rewards. The LP tokens can be unstaked at any time, and then burned to retrieve the corresponding deposited liquidity and LP Commission rewards.
Users can additionally profit from sLP tokens by staking them to receive Mirror Token (MIR) rewards. The sLP tokens can be unstaked and burned (with the minted mAsset) anytime to retrieve the corresponding amount of collateral.
Mirror Protocol distributes rewards to each mAsset staking pools in Staking contract based on the
weightparameter of each mAsset. mAsset pools as well as the MIR pool. All mAsset-UST staking pools receive a weight of 100 (newly whitelisted mAssets will have weight of 30), while the MIR pool receives a weight of 300. Therefore, there is a stronger reward incentive to stake to MIR pool as they confer 3 times the reward when staked relative to mAssets.
Within each mAsset's staking pool, MIR tokens are distributed to LP and sLP stakers, where sLP tokens reward weight can increase up to 40%, based on the current price premium between Terraswap and Oracle price. When enough short positions are created to lower the price premium, sLP reward weight will decrease, which automatically increases LP reward weight up to 100%. Below is the table of short reward distribution based on price premium:
The MIR reward,
for a specific staking pool corresponding to the asset
of MIR introduced into circulation, is given by:
The reward for LP staking pool, based on the current short reward ratio
The reward for sLP staking pool, based on the current short reward ratio
A user will receive the portion of rewards for their pool equivalent to their proportional share of staked LP and sLP for that pool.