curvefi / curve-frontend

MIT License
20 stars 22 forks source link

show MAX LTV for llamalend markets #163

Open amytsang opened 5 months ago

amytsang commented 5 months ago

The formilat for max ltv is:

In [1]: ltv = lambda x: ((x[0] - 1) / x[0])**2 * (1 - x[1])

In [2]: ltv((30, 0.11))
Out[2]: 0.8316555555555556

where x[0] is A, x[1] is loan discount normalised between 0 and 1 (so 11% is 0.11). multiply ltv by 100 to show percentage.

always show 'max ltv' which is the max possible loan at N=4 (not advisable but hey it exists!).