Protocol Math

Vault Ratio

The vault ratio is defined in the following way:

LetCaโ€‰beโ€‰theโ€‰amountโ€‰ofโ€‰collateralโ€‰depositedCpโ€‰beโ€‰theโ€‰priceโ€‰ofโ€‰theโ€‰collateralโ€‰Daโ€‰beโ€‰theโ€‰amountโ€‰ofโ€‰debtโ€‰Mintedโ€‰Dpโ€‰beโ€‰theโ€‰priceโ€‰ofโ€‰theโ€‰debtโ€‰Vrโ€‰beโ€‰theโ€‰vaultโ€‰ratioVr=Caโˆ—CpDaโˆ—Dbร—100\begin{gathered} Let\\ C_a\, be\, the\, amount\, of\, collateral\, deposited \\ C_p\, be\, the\, price\, of\, the\, collateral\, \\ D_a\, be\, the\, amount\, of\, debt\, Minted\,\\ D_p\, be\, the\, price\, of\, the\, debt\, \\ V_r\, be \, the\, vault\, ratio\\ V_r = \frac{C_a * C_p}{D_a * D_b} \times 100 \end{gathered}

Liquidation

The Index token needed to liquidate a vault is:

LetDLโ€‰beโ€‰theโ€‰amountโ€‰ofโ€‰indexโ€‰tokenโ€‰neededโ€‰toโ€‰liquidateโ€‰aโ€‰vaultLpโ€‰beโ€‰theโ€‰liquidationโ€‰penaltyโ€‰DL=Daโ€‰Dpโ€‰Vrโˆ’100โ€‰Caโ€‰CpDp(Vrโˆ’Lpโˆ’100)\begin{gathered} Let\\ D_L \, be\, the\, amount\, of\, index\, token\, needed\, to\, liquidate\, a\, vault \\ L_p\, be\, the\, liquidation\, penalty\, \\ \\ D_L = \frac{D_a\,D_p\,V_r - 100\,C_a\,C_p}{D_p (V_r - L_p - 100)} \end{gathered}

The reward received is given by:

LetCrโ€‰beโ€‰theโ€‰amountโ€‰ofโ€‰collateralโ€‰receivedโ€‰asโ€‰rewardโ€‰Cr=(Daโ€‰Dpโ€‰Vrโˆ’100โ€‰Caโ€‰Cp)(Lp+100)100โ€‰Cpโ€‰Dp(Vrโˆ’Lpโˆ’100)\begin{gathered} Let\\ C_r \, be\, the\, amount\, of\, collateral\, received\, as\, reward\,\\ \\ C_r = \frac{(D_a\,D_p\,V_r - 100\,C_a\,C_p)(L_p + 100)}{100\,C_p\,D_p (V_r - L_p - 100)} \end{gathered}

Fees

The mint fee and the fee are calculated in the following way:

Letโ€‰Bfโ€‰beโ€‰theโ€‰burnโ€‰feeโ€‰percentageLetโ€‰Mfโ€‰beโ€‰theโ€‰mintโ€‰feeโ€‰percentagemintFee=Caโ€‰Cpโ€‰Mf100โ€‰EpBurnFee=Caโ€‰Cpโ€‰Bf100โ€‰EpLet\, B_f\, be\, the\, burn\, fee\, percentage\\ Let\, M_f\, be\, the\, mint\, fee\, percentage\\ mintFee = \frac{C_a\,C_p\,M_f}{100\,E_p}\\ BurnFee = \frac{C_a\,C_p\,B_f}{100\,E_p}\\

Math Derivation

For the derivation of the formulae please refer to this medium article