> For the complete documentation index, see [llms.txt](https://flary-finance.gitbook.io/flary-finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flary-finance.gitbook.io/flary-finance/interaction-with-flary/interest-rate.md).

# Interest rate

### Borrow Interest Rate

Flary's interest rate algorithm is finely tuned to address liquidity risk and optimize asset utilization. The borrow interest rates are determined by the Utilization Rate $$U$$, which indicates the availability of capital within the platform. This model effectively manages liquidity risk by incentivizing users to maintain liquidity:

During periods of ample capital availability, lower interest rates are set to encourage borrowing.

During periods of limited capital availability, higher interest rates are applied to incentivize timely debt repayments and additional asset supplying.

Our approach ensures a balanced liquidity environment, promoting efficient capital deployment across the platform.

### Flary's Interest Rate Model

Flary's interest rate model addresses liquidity risk, which materializes when utilization is high, particularly as $$U$$ approaches 100%. To manage this, the interest rate curve is bifurcated around an optimal utilization rate $$U\_{\text{optimal}}$$. Below this optimal rate, the slope of the curve is shallow, but it rises sharply once $$U$$ exceeds $$U\_{\text{optimal}}$$.

#### Interest Rate Calculation

The interest rate $$R\_t$$​ follows the model:

* ​$$If U≤ U\_{\text{optimal}}: R\_t = R\_0 + \left(\frac{U\_t}{U\_{\text{optimal}}}\right) R\_{\text{slope1}}​$$

  $$If U > U\_{\text{optimal}}: Rt=R0+ R\_{\text{slope1}} + \left(\frac{U\_t - U\_{\text{optimal}}}{1 - U\_{\text{optimal}}}\right) R\_{\text{slope2}}​$$

#### Compounded Interest Calculation

In the borrow rate technical implementation, the `calculateCompoundedInterest` method approximates the interest, primarily affecting high rates. The resulting actual borrow rate is given by:

$$Actual APY=(1+{Theoretical APY}/{secs per year}​)^{secs per year}−1$$

#### Rate Dynamics

* **Below** $$U\_{\text{optimal}}$$**:** Borrow interest rates increase slowly with utilization.
* **Above** $$U\_{\text{optimal}}$$**​:** Borrow interest rates rise sharply, potentially exceeding 50% APY if liquidity is fully utilized.

### Variable vs. Stable Interest Rates

Both variable and stable interest models are derived from the formula above, with different parameters for each asset.

* **Variable Debt:** Rates evolve constantly with utilization.
* **Stable Debt:** Rates remain fixed at issuance until specific rebalancing conditions are met. In V3, interest models are optimized with the new rate strategy parameter Optimal Stable/Total Debt Ratio to algorithmically manage stable rates.

$$\text{If } \text{ratio} < \text{ratio}\_o: R\_t = r\_0 + \left( \frac{\text{ratio} - \text{ratio}\_o}{1 - \text{ratio}*o} \right) R*{\text{base}}$$

## Flary Finance Model Parameters

Firstly, it’s crucial to differentiate assets primarily used as collateral, typically volatile, necessitating continuous liquidity to facilitate prompt liquidations. Secondly, the liquidity of assets on Flary is pivotal; higher liquidity fosters more stable utilization. Consequently, assets with lower liquidity levels should observe more conservative interest rates.

Considering market conditions is equally important; Flary’s borrowing costs must align with prevailing yield opportunities to prevent potential rate arbitrage. With the rise of liquidity mining, Flary has adjusted borrowing costs by reducing the optimal utilization of affected assets. This adjustment has increased borrowing costs, partially offset by liquidity rewards.

#### Variable Interest Rate Model Parameters

Variable rate parameters:

* $$U\_{\text{optimal}}$$
* Base Variable Borrow Rate
* Variable Rate Slope 1
* Variable Rate Slope 2

#### Stable Interest Rate Model Parameters

Stable rate parameters:

* $$U\_{\text{optimal}}$$
* Base Variable Borrow Rate
* Variable Rate Slope 1
* Variable Rate Slope 2
* Stable to Total Debt Ratio

The stable rate provides predictability for the borrower; however, it comes at a cost, as the interest rates are higher than the variable rate.

The assets that are most exposed to liquidity risk do not offer stable rate borrowing.

The base rate of the stable rate model corresponds to the average market rate of the asset.

#### Stable Interest Rate Rebalance

In certain conditions, the protocol enables stable rates to be rebalanced to avoid a large percentage of liquidity being borrowed at a stable rate below the market variable rate. In V3, the condition for rebalance is if the current supply rate ≤\leq≤ supply rate if all borrows are variable ×0.9\times 0.9×0.9, smart contract reference.

#### V3 Interest Rate Parameters

The interest rate parameters for V3 markets have been deployed with 3 interest rate strategies calibrated per cluster of assets that share similar risk profiles.

**Rate Strategy Volatile One**

Volatile assets need liquidity at all times and are thus calibrated at a low Optimal Utilisation Ratio.

**Assets:**  LINK, WMATIC, WETH, WBTC, WAVAX, WFTM, SUSHI

**Parameters:**

| Parameter                          | Value |
| ---------------------------------- | ----- |
| Optimal Usage                      | 45%   |
| Base Variable Borrow Rate          | 0%    |
| Variable Rate Slope 1              | 4%    |
| Variable Rate Slope 2              | 300%  |
| Base Stable Borrow Rate            | 2%    |
| Stable Rate Slope 1                | 7%    |
| Stable Rate Slope 2                | 300%  |
| Optimal Stable to Total Debt Ratio | 20%   |

**Rate Strategy Stable One**

Low liquidity stablecoins have a lower Optimal Utilisation Ratio than those with higher liquidity.

**Assets:** DAI

**Parameters:**

| Parameter                          | Value |
| ---------------------------------- | ----- |
| Optimal Usage                      | 90%   |
| Base Variable Borrow Rate          | 0%    |
| Variable Rate Slope 1              | 4%    |
| Variable Rate Slope 2              | 60%   |
| Base Stable Borrow Rate            | 2%    |
| Stable Rate Slope 1                | 0.5%  |
| Stable Rate Slope 2                | 60%   |
| Optimal Stable to Total Debt Ratio | 20%   |

**Rate Strategy Stable Two**

High liquidity stablecoins which are calibrated to lower rates to encourage borrowing.

**Assets:** USDC, USDT, AGEUR

**Parameters:**

| Parameter                          | Value |
| ---------------------------------- | ----- |
| Optimal Usage                      | 80%   |
| Base Variable Borrow Rate          | 0%    |
| Variable Rate Slope 1              | 4%    |
| Variable Rate Slope 2              | 75%   |
| Base Stable Borrow Rate            | 1%    |
| Stable Rate Slope 1                | 0.5%  |
| Stable Rate Slope 2                | 75%   |
| Optimal Stable to Total Debt Ratio | 20%   |

When market conditions change, the interest rate parameters must be adapted to utilization on Flary’s market as well as to incentives across DeFi.

#### Supply Rate

The borrow interest rates paid are distributed as yield for aToken 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, $$D\_t$$​, is:

$$
S\_t = U\_t \left( \frac{S\_{B\_t}}{S\_t} + \frac{V\_{B\_t}}{V\_t} \right) (1 - R\_t)
$$

Where:

* $$U\_t$$​ is the utilization ratio
* $$SB\_t$$​​ is the share of stable borrows
* $$S\_t$$​ is the average stable rate
* $$VB\_t$$ is the share of variable borrows
* $$V\_t$$ is the variable rate
* $$R\_t$$​ is the reserve factor

You can view the protocol's deposit APY on the Flary App for each asset.

#### &#x20;<br>

<br>
