Taker
Search
K

InterestRateCalculator

Interest Rate Model

Taker’s interest rate algorithm is calibrated to manage liquidity risk and optimise utilisation. The borrow interest rates are derived from the Utilisation Rate
UU
.
UU
is an indicator of the availability of capital within the pool. The interest rate model manages liquidity risk in the protocol through user incentives to support liquidity:
  • When capital is available: low interest rates to encourage borrowing.
  • When capital is scarce: high interest rates to encourage repayments of debt and additional supplying.

Borrow Interest Rate

Liquidity risk materialises when utilisation is high, and this becomes more problematic as
UU
gets closer to 100%. To tailor the model to this constraint, the interest rate curve is split in two parts around an optimal utilisation rate
UoptimalU_{optimal}
. Before
UoptimalU_{optimal}
the slope is small, after it begins rising sharply.
The interest rate
RtR_t
follows the model:
ifUUoptimal:Rt=R0+UtUoptimalRslope1if \hspace{1mm} U \leq U_{optimal}: \hspace{1cm} R_t = R_0 + \frac{U_t}{U_{optimal}} R_{slope1}
ifU>Uoptimal:Rt=R0+Rslope1+UtUoptimal1UoptimalRslope2if \hspace{1mm} U > U_{optimal}: \hspace{1cm} R_t = R_0 + R_{slope1} + \frac{U_t-U_{optimal}}{1-U_{optimal}}R_{slope2}
  • UU
    , the utilisation ratio
  • UoptimalU_{optimal}
    , the optimal utilisation ratio
  • RtR_t
    , the borrow interest Rate
  • R0R_0
    , the base borrow interest rate
  • Rslope1R_{slope1}
    , the rate slope 1
  • Rslope2R_{slope2}
    , the rate slope 2

Supply Interest rate

The borrow interest rates paid are distributed as yield for Token holders who have supplied to the protocol, excluding a share of yields sent to the ecosystem reserve defined by the reserve factor. This interest rate is generated on the asset that is borrowed out then shared among all the liquidity providers. The supply APY is:
St=URt(1F)S_t = U R_t(1-F)
  • UU
    , the utilisation ratio
  • RtR_t
    , the borrowt interest rate
  • FF
    , the reserve factor

Model Parameters

bluechip
growth
Parameters
Value
Optimal Utilisation ratio
45%
Base Borrow Rate
0
Rate Slope 1
4%
Rate Slope 2
300%
Reserve Factor
10%
Parameters
Value
Optimal Utilisation ratio
45%
Base Borrow Rate
0
Rate Slope 1
4%
Rate Slope 2
300%
Reserve Factor
10%

implement

Calculate deposit and borrowing rates using the total deposit amount, total borrowing amount, and reserve factor.
function calculateInterestRates(
uint256 totalLiquidity,
uint256 totalDebt,
uint256 reserveFactor
) external view override returns (uint256 depositRate, uint256 borrowRate)

call params

Name
Type
Description
totalLiquidity
uint256
the total liquidity in ETH.
taotalDebt
uint256
the total debt in ETH.
reserveFactor
uint256
reserve factor. It represents the proportion of interest earned on loans that is retained by the protocol as a reserve.

return value

Name
Type
Description
depositRate
uint256
deposit rate
borrowRate
uint256
borrowing rate