The Annual Percentage Rate (APR), is a measure of the cost of borrowing money, expressed as a yearly rate.
The Annual Percentage Yield (APY) is a measure of the total return on an investment over a year, including both interest and compounding.
In DeFi, rates are typically expressed with either APR or APY. The main difference between the two is that APY includes compounding.
The Earn rate you see in the SwissBorg app represents the APY.
Let’s say there is an Earn strategy that takes 3 months to conclude and offers 5.12% APY. You put $1000 into this strategy, and want to do a calculation to make sure that the actual Annual Percentage Yield is displayed.
After 3 months the strategy is concluded, and you are paid out your principal investment of $1000 plus the $12.50 earnings from yield. You can use the following calculation to confirm the APR:
APR = (Interest / Principal) x (1 / Time Period Expressed in Years)
To get the first part of the equation, you simply calculate 12.50 / 1000 = 0.0125.
To get the second part, you must first express the time period in years. In this example the timeframe is 3 months, meaning 3/12 of a year.
The full calculation is then: 0.0125 x (12/3) = 0.05= 5%
We had to flip the fraction, because we have to multiply with 1 / Time Period.
Since APY is, in essence, just a compounded APR, it makes sense that we can use the latter to calculate the former:
APY = (1 + (APR / Number of Compounding Periods))^(Number of Compounding Periods) - 1
Where possible, SwissBorg compounds your interest on a daily basis. This means the “Number of Compounding Periods” is 365.
We have determined that the APR is 0.05 (5%), and dividing that by 365 gives us 0.0001369. By adding 1, we get 1.0001369, of which we’ll need to calculate the 365th power, giving us 1.0512343866. Then we just need to remove the 1, which gives us .0512 (= 5.12% APY, just as advertised).
It is important to note that the APY displayed in the app is, in most cases, our best estimate based on past data. Yield is typically variable, and therefore it cannot be exactly predicted. However, we always make sure that the number you see is the most accurate one we can provide.