osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Add new interest rate model #64

Closed ethanfrey closed 2 years ago

ethanfrey commented 2 years ago

We currently define a simple Linear interest rate model like compound v1. However, this is an enum, so we can implement other methods.

In particular, we should add the piecewise-linear "target rate" model from Aave. Basically, there is some target utility rate (T). If utilization is <= T, this is a simple linear increase from some base to a target rate. After the target rate, it becomes a much steeper linear curve from between T and 1.0.

U, utilization rate, is calculated the same as we currently do it.