Interest Rate Model
OT Interest model is 2-slop based mechanism
const otBorrowRate = function (r0, u, uOptimal, slop1, slop2) {
let rate;
if (u < uOptimal) {
rate = r0 + (u / uOptimal) * slop1;
} else {
rate = r0 + slop1 + ((u - uOptimal) / (1 - uOptimal)) * slop2;
}
return rate;
};
const main = function () {
const assetConfigArray = [
[[0.8, 0, 0.04, 1], 0.02, "USDC"],
[[0.8, 0, 0.04, 1], 0.85, "USDC"],
[[0.65, 0, 0.08, 1], 0.02, "ETH"],
[[0.65, 0, 0.08, 1], 0.7, "ETH"],
];
for (const assetConfig of assetConfigArray) {
const [config, u, asset] = assetConfig;
const [uOptimal, r0, slop1, slop2] = config;
console.log(
asset,
`on Utilization Rate = ${u} Interest Rate is ${otBorrowRate(r0, u, uOptimal, slop1, slop2)}`
);
}
};
main();
Variable Interest Rate Model Parameters
Stable Interest Rate Model Parameters
Interest Rate Parameters Change
Last updated