APY Calculation

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 new block added to the blockchain.

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

U=UtilizationRate=AmountBorrowedAmountSuppliedU = UtilizationRate = \frac{AmountBorrowed}{AmountSupplied}
  • 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.

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

The graph of APR and APY dependence on Utilization Rate looks like this:

Supply Rate

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

The Supply Rate function is split in two parts around an optimal utilization rate UoptU_{opt}:

SupplyRate={U(R0+UUoptRslope1)(1ProtocolFee),if U<UoptU(R0+Rslope1+UUopt1UoptRslope2)(1ProtocolFee),if UUoptSupplyRate = \begin{cases} U\cdot\bigg(R_0+\frac U{U_{opt}}R_{slope1}\bigg)\cdot\bigg(1 - ProtocolFee\bigg) ,&if\ U<Uopt\newline U\cdot\bigg(R_0+R_{slope1}+\frac{U-U_{opt}}{1 -U_{opt}}R_{slope2}\bigg)\cdot\bigg(1 - ProtocolFee\bigg),&if\ U\ge Uopt \end{cases}

Where:

  • R0R_0, Rslope1R_{slope1}, Rslope2R_{slope2} are asset parameters,

  • ProtocolFeeProtocolFee ​is a share of the borrow interest rate sent to the protocol.

Supply APY​

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

Supply APY is calculated as follows:

SupplyAPY=(1+SupplyRateBlocksPerYear)BlocksPerYear1SupplyAPY = \bigg(1 + \frac{SupplyRate}{BlocksPerYear}\bigg)^{BlocksPerYear} - 1

Since roughly one new block is added to the blockchain every minute, the following calculation is used:

What is Borrow APY?

Users taking loans pay interest. Both Borrow Rate (APR) and Annual Percentage Yield (APY) for an asset change based on its market use:

U=UtilizationRate=AmountBorrowedAmountSuppliedU = UtilizationRate = \frac{AmountBorrowed}{AmountSupplied}
  • When there are a lot of assets, interest is low to get people to borrow.

  • When there's not much, interest is high to get people to pay back and add more.

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 utilization rate UoptU_{opt}​:

BorrowRate={R0+UUoptRslope1,if U<UoptR0+Rslope1+UUopt1UoptRslope2,if UUoptBorrowRate = \begin{cases} R_0+\frac U{U_{opt}}R_{slope1} ,&if\ U<Uopt\newline R_0+R_{slope1}+\frac{U-U_{opt}}{1 -U_{opt}}R_{slope2},&if\ U\ge Uopt \end{cases}

Where R0R_0, Rslope1R_{slope1}, Rslope2R_{slope2} are asset parameters.

Borrow APY

Your borrowed amount grows with every new block 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:

Last updated