# Interest Rates

Finny has three important values used to calculate accurate interest rates - the utilization rate, supply rate and borrow rate.

## Utilization Rate

The utilization rate of a market is the ratio between total borrowed assets and total lent assets - think of it as the percentage of used assets in a market. It is the core of the interest rate model.

The utilization rate $$R$$ of a market $$x$$ can be formally defined as

$$R\_x=Borrowed\_x​/(Supplied\_x​+Borrowed\_x​−Reserves\_x​)$$.\
\
Reserves being, the total amount that Finny currently has as profit (more on this later).

## Borrow Rate

The supply rate of a market is the interest of borrowers paid yearly. That is, the delta borrowers have to include when repaying an open position.

It can be formally defined as:\
$$B\_x=Mul\_x ∗ R\_x+Base\_x$$

{% hint style="info" %}

* $$Mul\_x$$ refers to the multiplier of a market - which is the rate of increase in interest rate in regards to the utilization.
* $$R\_x$$ being the utilization rate of market $$x$$.
* $$Base\_x$$ refers to the base rate of a market - the ever possible minimum borrowing rate.
  {% endhint %}

So for example, there are 1000 BTC supplied, and 100 BTC borrowed, which gives us a 10% utilization rate, the multiplier for BTC is set at 20% and the base rate at 5%. The borrow rate for BTC would be 7%, seen as follows:

$$B\_x = 0.2 \* 0.1 + 0.05 = 0.07$$

## Supply Rate

The supply rate is the yield (or APY) that is given to suppliers. The supply rate $$S$$ of market $$x$$ is defined as follows:

$$S\_x = B\_x \* R\_x \*(1 - Rf\_x)$$

{% hint style="info" %}

* $$B\_x$$ is the borrow rate of the market.
* $$R\_x$$ is the utilization rate of the market.
* $$Rf\_x$$ being the reserve factor of the market - the percentage of the delta between $$S\_x$$ and $$B\_x$$ that Finny stores as profit.
  {% endhint %}

Let's go through a scenario using the same market as in the borrow rate (BTC) - it has a 10% utilization rate, the borrow rate is 7% and the reserve factor is set to 15%. The supply rate would be 0.59%, calculated as follows:

$$S\_x = 0.07 \* 0.1 \* (1 - 0.15)$$

### How is interest accrued?

Borrow interest is accrued each time there is a successful call of any of the following methods:

* `Borrow()`
* `Mint()`
* `Repay()`
* `Redeem()`

{% hint style="info" %}
These methods all alter the ratio of assets in the protocol.
{% endhint %}

As such, the rates are ever-changing, and the really attractive supply rate that you are obtaining today can fluctuate heavily depending on large movements between the borrowed and supplied assets.
