Interest rate

If the borrower's loan amount is less than Maximum loan amount, the borrowing time is T, the value of the NFT pledged by the borrower is V, the amount of the borrower's token is M. When the NFT holder pledges a NFT, the contract can automatically calculate the maximum loan amount based in the corresponding pool, as well as its interest rate. Different loan amounts have different interest rates. The specific calculation method is as follows:

When a1a_1a2a_2a3a_3……ana_nare borrowed from n fund pairs, in each fund pair, the number of tokens borrowed should be less than the total amount of the pair , that is, ana_n<=xnmx_{nm}. Then a1a_1a2a_2a3a_3……ana_n need to meet the following constraints:

{M=a1+a2+ana1+a1x1rTVx1c+a2+a2x2rTVx2c++an+anxnrTVxnc<1\begin{cases} M=a_1+a_{2}+……a_{n} \\ \frac {a_1+a_1*x_1r*T}{V*x_1c}+\frac {a_2+a_2*x_2r*T}{V*x_2c}+……+\frac {a_n+a_n*x_nr*T}{V*x_nc}<1\\ \end{cases}

Then its comprehensive interest rate is:

AverageRate=a1x1r+a2x2r+...+anxnrVAverageRate=\frac {a_1*x_1r+a_2*x_2r+...+a_n*x_nr}{V}

The solution with the lowest AverageRate, which meets all the above conditions, is the optimal solution provided by the platform. The interest rate is fixed, and the borrowers can borrow any value that is less than the maximum loan amount, and the system will find the optimal combination of liquidity token pairs that meet the above constraints with a lowest interest rate.

Last updated