APY Calculation

What is Borrow APY?

Users taking loans pay interest. Both Borrow Rate (APR) and Annual Percentage Yield (APY) for an asset change dynamically depending on the asset's utilisation rate.

Utilization Rate=Amount BorrowedAmount Supplied\text{Utilization Rate} = \frac{\text{Amount Borrowed}}{\text{Amount Supplied}}
  • When the asset is available, interests are low to encourage borrowing.

  • Interests are high when the asset is scarce to encourage debt repayments and additional supply.

Borrow APY includes interest on interest, but Borrow Rate doesn't.

Borrow Rate

Borrow Rate (or APR) is the yearly interest borrowers pay without adding the extra from compound interest.

The Borrow Rate has two parts, divided by the best utilisation rate:

Borrow Interest Rate={Base Borrow Rate+Borrow Rate Slope LowUtilization,if  UtilizationTarget UtilizationBase Borrow Rate+Borrow Rate Slope LowTarget Utilization+Borrow Rate Slope High(UtilizationTarget Utilization),if  Utilization>Target Utilization\begin{align*} \text{Borrow Interest Rate} &= \begin{cases} \text{Base Borrow Rate} + \text{Borrow Rate Slope Low} \cdot \text{Utilization},\\ \text{if } \text{\, Utilization} \leq \text{Target Utilization} \\[2ex] \text{Base Borrow Rate} + \text{Borrow Rate Slope Low} \cdot \text{Target Utilization}\\ + \text{Borrow Rate Slope High} \cdot (\text{Utilization} - \text{Target Utilization}), \\ \text{if } \text{\, Utilization} > \text{Target Utilization} \end{cases} \\ \end{align*}

Where:

Borrow Interest Rate:The interest rate charged on borrowed assetsBase Borrow Rate:The minimum borrowing interest rateBorrow Rate Slope Low:The rate of increase for the borrow rate when utilization is below or at the targetBorrow Rate Slope High:The rate of increase for the borrow rate when utilization is above the targetUtilization:The current utilization ratio of the assets in the protocolTarget Utilization:The desired utilization ratio for optimal performance\begin{align*} \text{Borrow Interest Rate} &: \text{The interest rate charged on borrowed assets} \\ \text{Base Borrow Rate} &: \text{The minimum borrowing interest rate} \\ \text{Borrow Rate Slope Low} &: \text{The rate of increase for the borrow rate when utilization is below or at the target} \\ \text{Borrow Rate Slope High} &: \text{The rate of increase for the borrow rate when utilization is above the target} \\ \text{Utilization} &: \text{The current utilization ratio of the assets in the protocol} \\ \text{Target Utilization} &: \text{The desired utilization ratio for optimal performance} \\ \end{align*}

Borrow APY

Your borrowed amount grows with every new second due to compounding. Borrow APY (annual percentage yield) refers to the yearly interest paid by borrowers, considering the effect of compounding.

Borrow APY is calculated as follows:

Borrow APY=(1+Borrow Interest RateSeconds Per Year)Seconds Per Year1 \text{Borrow APY} = \left(1 + \frac{\text{Borrow Interest Rate}}{\text{Seconds Per Year}}\right)^{\text{Seconds Per Year}} - 1 \\ \\ \\ \\

What is Supply APY?

Users who supply collect income from the users who borrow. This income is given in the same token as the supply and compounds with every second.

The Supply Rate (APR) and Supply APY of an asset on a specific market are calculated dynamically depending on the asset's utilization rate, too.

The Supply APY considers compound interest, while the Supply Rate does not.

Supply Rate

The Supply Rate (annual percentage rate, APR) refers to the yearly interest paid to investors without considering compounding:

Supply Interest Rate=Borrow Interest Rate(1Reserve Factor)Utilization\begin{align*} \text{Supply Interest Rate} &= \text{Borrow Interest Rate} \cdot \left(1 - \text{Reserve Factor}\right) \cdot \text{Utilization} \end{align*}

Where:

Supply Interest Rate:The interest rate paid to suppliers of assetsBorrow Interest Rate:The interest rate charged on borrowed assetsReserve Factor:The portion of interest set aside as reservesUtilization:The current utilization ratio of the assets in the protocol\begin{align*} \text{Supply Interest Rate} &: \text{The interest rate paid to suppliers of assets} \\ \text{Borrow Interest Rate} &: \text{The interest rate charged on borrowed assets} \\ \text{Reserve Factor} &: \text{The portion of interest set aside as reserves}\\ \text{Utilization} &: \text{The current utilization ratio of the assets in the protocol} \\ \end{align*}

Supply APY​

The supplied amount grows with every new second thanks to compounding. Supply APY (annual percentage yield) is the yearly interest paid to investors, including compounding interest.

Supply APY is calculated as follows:

Supply APY=(1+Supply RateSeconds Per Year)Seconds Per Year1\text{Supply APY} = \left(1 + \frac{\text{Supply Rate}}{\text{Seconds Per Year}}\right)^{\text{Seconds Per Year}} - 1

What is Net APY?

Net APY (Annual Percentage Yield) reflects the overall profitability or unprofitability of your account on a lending platform, considering both the interest earned on supplied assets and the interest paid on borrowed assets. It is calculated based on the margin between these values relative to the total supplied or borrowed value.

  • For Borrowers: Net APY is calculated by subtracting the borrow APY (interest paid on loans) from the supply APY on your collateral (interest earned on assets you have supplied). This gives you an idea of the net cost or benefit of your borrowing activities.

  • For Suppliers: Net APY is simply the supply APY, as it reflects the interest earned on the assets you've supplied to the platform.

Here's how it works:

Margin=assets(SuppliedValueiSupplyAPYiBorrowedValueiBorrowAPYi)Margin = \sum_{assets} (SuppliedValue_i \cdot SupplyAPY_i - BorrowedValue_i \cdot BorrowAPY_i)

This formula takes into account both supplied and borrowed assets across all asset types, providing a comprehensive view of the account's performance. It considers the interest earned on supplied assets (SupplyAPY) and the interest paid on borrowed assets (BorrowAPY), weighted by their respective values.

NetAPY={MargintotalSuppliedValue,if Margin > 0MargintotalBorrowedValue,if Margin < 00,if Margin = 0NetAPY = \begin{cases} \frac{Margin}{totalSuppliedValue}, & \text{if Margin > 0} \\[2ex] \frac{Margin}{totalBorrowedValue}, & \text{if Margin < 0} \\[2ex] 0, & \text{if Margin = 0} \end{cases}

The resulting Net APY gives users a single metric to understand their overall position, whether they are net suppliers (positive Margin) or net borrowers (negative Margin) across all their activities on the platform.

Last updated