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