Staking Mechanism
What all stakers need to know when staking tokens in InsurAce.io

Mining

Mining Pools

Mining pools are fundamental elements of the InsurAce.io mutual cover model. The team has put them in place to act as liquidity reservoirs. InsurAce.io Protocol provides coverage capability backed by substantial capital gathered in the mining pools.
The DeFi market is dynamic and a selection of tremendous DeFi tokens are available on the market. InsurAce.io builds mining pools based on the below considerations following market development:
  • Popularity
  • Liquidity
  • Price Volatility
Currently, InsurAce.io provides the following mining pools:
InsurAce.io may introduce new mining pools based on market developments.

LPTokens

LPTokens are tokens used to prove the stake of the corresponding principal token (ETH/DAI…) in mining pools. The following are important factors to consider with regards to LPTokens:
  • LPTokens are minted and attached to the staker's wallet as soon as the staker starts staking.
  • Once the staker withdraws the principal tokens (ETH/DAI) from the respective mining pool, their corresponding LPTokens are burned by InsurAce.io.
  • As of this moment, LPTokens are non-transferable, non-exchangeable and do not consider an asset to be staked in another platform.
  • It is vital not to burn LPTokens in order to avoid loss in the principal token in the pool.
The end-user does not need to interact with LPTokens directly.

Mining Pool Factor

LPTokens are minted are based on the mining pool's factor
μμ
μt=LPTokentPrincipaltμ_t = \frac {LPToken_t} {Principal_t}
where
  • tt
    is the principal token of the pool
  • Principalt{Principal_t}
    is the remaining principal token in the pool
  • LPTokentLPToken_t
    is the remaining LPToken in the pool
In other words,
μtμ_t
is the amount of
LPTokentLPToken_t
you will get when you stake 1 Token
tt
.

LPToken Minting

The formula for LPTokens minting is
ΔLPTokent=μt×Staket\Delta{LPToken}_t = μ_t \times{Stake_t}
where
  • tt
    is the principal token of the pool
  • StaketStake_t
    is the amount of principal token end-user staked in
  • ΔLPTokent\Delta{LPToken}_t
    is the Amount of LPTokens
    tt
    to be minted

Example

Take ETH capital for example. A staker is staking 10 ETH into the mining pool. The ETH pool's factor
μETHμ_{ETH}
is 1 at that moment. The amount of
LPTokenETHLPToken_{ETH}
he will get is
ΔLPTokenETH=μETH×StakeETH=1×10=10\Delta{LPToken}_{ETH} = μ_{ETH} \times Stake_{ETH} = 1 \times 10 = 10

Rewards

Staking is considered one of the key elements to building up InsurAce.io. $INSUR, as the governance token, will be rewarded to all stakers, based on the below formula:

$INSUR Distribution Formula for staking

Rewards are calculated based on the following formula
Rewards=t=0T(X×Y×N×KZ×J)Rewards = \displaystyle\sum_{t=0}^T ( \frac {X \times Y \times N \times K} {Z \times J})
where
  • X = INSUR Released Per Block
  • Y = Token Pool Weightage
  • Z = Total Pools Weightage
  • K = Amount of
    LPTokentLPToken_t
    staker holding
  • J = Total Supply of
    LPTokentLPToken_t
  • N = Number of Blocks between events
  • T = Sequence of Stake or Withdraw Happened
To better understand the above formula, see this straightforward example. Assume we have:
  • Two Token Pools, one is ETH, the other one is DAI
  • Weightage for each pool is 50:50
  • Per block, we release 2 INSUR token
  • UserA stakes in 1 ETH in block 1
  • UserB stakes in 1 ETH in block 10
Some calculations:
  1. 1.
    For ETH pool, the per block INSUR released will be (2 * 50)/(50 + 50) = 1 INSUR
  2. 2.
    From block 1 to block 10, only UserA staked here, so the reward for him is (10 - 1)*1*1/1 = 9.
  3. 3.
    From block 10 onwards, UserB also joins the party, therefore these two will share the INSUR per block.
    1. 1.
      For UserA, reward per block is 1*1/(1+1) = 0.5
    2. 2.
      For UserB, reward per block is 1*1/(1+1) = 0.5
The more blocks a staker has experienced or staked in, the more INSUR tokens the staker will be rewarded.

APY Calculation

Step 1: Calculate the reward per block of a mining pool

where
  • R = The reward per block of the mining pool (in INSUR)
  • RallR_{all}
    = The total reward for all mining pools (in INSUR), obtained from the rewardPerBlock function in StakersPool contract.
  • W = The weight of the mining pool, obtained from the poolWeightPT function in StakersPool contract.
  • WallW_{all}
    = The sum of the weights of all mining pools, obtained from the totalPoolWeight function in StakersPool contract.

Step 2: Calculate the APY of a mining pool

where
  • A = The APY of the mining pool
  • N = The number of blocks mined in a year. For the Ethereum blockchain, this is set to the number of seconds in a year / average block time = 365 x 24 x 60 x 60 / 15 = 2102400.
  • R = The reward per block of the mining pool (in INSUR), obtained from step 1.
  • PINSURP_{INSUR}
    = The price of INSUR (in USDC), can be obtained from any price provider.
  • V = The total value locked in a mining pool, obtained from the stakedAmountPT function in StakersPool contract.
  • P = The price of the token of the mining pool (in USDC), can be obtained from any price provider.

Example

Before we can calculate the APY of the INSUR mining pool, we need to know the staking data (by querying the blockchain) and the prices of the tokens.
The StakersPool contract (address: 0x136D841d4beCe3Fc0E4dEbb94356D8b6B4b93209) has functions that provide the staking data we need.
  • function rewardPerBlock() view returns (uint256) : We can get
    RallR_{all}
    by calling this function.
  • function totalPoolWeight() view returns (uint256) : We can get
    WallW_{all}
    by calling this function.
  • function poolWeightPT(address lpToken) view returns (uint256) : We can get W by calling this function with the “lpToken” parameter set to the LPTokenINSUR token address (0x7e68521a2814a84868Da716b9f436b53e6764C1D).
  • function stakedAmountPT(address token) view returns (uint256) : We can get V by calling this function with the “token” parameter set to the INSUR token address (0x544c42fBB96B39B21DF61cf322b5EDC285EE7429).
We can get the prices of the tokens by checking any price providers, such as 1inch, CoinGecko etc. In particular, we are interested in
  • PINSURP_{INSUR}
    – The price of INSUR in USDC
  • P – The price of the token of the mining pool in USDC (in this example, this happens to be the same as
    PINSURP_{INSUR}
    )
After getting all the data, we can calculate the APY of the INSUR mining pool as follows:

Reference

  • Tokens
The contract address for the mining tokens and the LP tokens can be found below:
  • Contract
StakersPool
Address: 0x136D841d4beCe3Fc0E4dEbb94356D8b6B4b93209

Additional topic

Rounding Loss

Rounding loss may occur if dividing results in infinite decimals due to the precision limitation of smart contracts. Though the round loss is negligible, we would like to elaborate on it with the calculation below so that it is clear.
Taking ETH Pool, for example, suppose when more people staking in and there are 9000 ETH in ETH Pool, and 10000 LPTokenETH minted, and the staker plan to stake in another 10 ETH, the minted LPTokenETH will be 11.111111111111111111.
ΔLPTokenETH=PrincipalETH×StakeETHLPTokenETH\Delta{LPToken}_{ETH} = \frac {Principal_{ETH} \times Stake_{ETH}} {LPToken_{ETH}}
=10×100009000=11.1111111111111111= \frac {10 \times 10000} {9000} = 11.1111111111111111
Following the above formula, the ETH value the staker can claim back will be (not including the withdrawal fee and etc.):
ΔUnstakeETH=ΔLPTokenETH×PrincipalETHLPTokenETH\Delta{Unstake}_{ETH} = \frac {\Delta{LPToken_{ETH}} \times Principal_{ETH}} {LPToken_{ETH}}
=11.111111111111111111900010000=9.99999999999999999= \frac {11.111111111111111111 * 9000} {10000} = 9.99999999999999999
The rounding loss is
1/10171/10^{17}
ETH which is negligible.

Events impacting Capital Pool Factor

The capital pool factor is 1 at the start of any capital pool. The capital pool factor will stay constant unless events have been triggered that change the ratio between the principal token and the LPToken.
Claiming is one of the events which will change the ratio since mining pools share a portion of claim payouts. Besides having the right to get rewards from InsurAce.io, the staker bears the obligation for claim payouts. When the community approves a claim payout, a portion of the mining pool will be forked out, based on weightage, to compensate for the claim owner's loss. As a result, less principal will be received upon unstaking and more LPTokens will be staked with the same amount of principal tokens.