APR/APY In-Depth Guide For DeFi

Jeremy
KogeCoin
Published in
15 min readJan 4, 2022

I dare you to NOT learn something new by the end of this article. Think you’ve got it all covered? We will see by the end…

If you use DeFi, you might constantly ask yourself, how much money will I earn by providing liquidity on this platform? Is it worth the potential risk based on the volatility of the underlying tokens? What will I earn in a day? A month? A year?

Determining your estimated return is a key aspect of decision-making in DeFi and understanding the difference between APR and APY is at the heart of this discussion. We’ll start simple, then work our way up through the juicy details.

APR and APY are both ways of measuring interest. APR stands for annual percentage rate while APY stands for annual percentage yield. However, their names don’t help much when it comes to understanding the difference between the two. The difference between the two all comes down to compounding.

APY includes compounding, while APR does not. So APR will look like a flat line, while APY will look like an exponential curve up. We can say that APR is simple interest, and APY is compound interest.

APR is linear while APY is exponential. Image by JeremyDefiDance

In DeFi yield farming, the difference between APR and APY is determined by your choices — whether you choose to compound your interest or not. If you were to earn a return and always cash out (for example by withdrawing your reward into a bank account) you would be earning an APR since you are choosing to pocket the money rather than reinvesting. If instead, you reinvested your reward, you would then begin to earn an APY.

Since I’ll be throwing around the word compounding a lot in this article, it helps to know what that actually looks like in DeFi. To compound in DeFi, first, you harvest your reward. This moves the reward you’ve accumulated from the protocol into your wallet. Then you swap the reward back into the form of your original investment. Then you deposit that amount back into the protocol. The more frequently you do this, the faster your investment will grow.

KogeFarm compounds for you by always reinvesting your reward back into your original staked assets. This lets you harness the power of compounding without paying gas fees or taking the time to compound 24 times a day by yourself.

By reinvesting the money (compounding) you are not only earning a reward on your principal amount, but in addition, you begin earning a reward on your reinvested amount. This ever so slightly increases the reward you will earn the following day. Do this enough times and you’ll quickly see that the amount you can earn grows dramatically over time.

I’ll show the same APR/APY image I shared above, but this time look closely at the beginning of the graph. You’ll notice that in the beginning the APR (without compounding) and the APY (with compounding) are almost identical. It isn’t until much later on that they diverge significantly as the APY continues to grow exponentially. How long will it take before they diverge significantly? Well, it depends on the math behind compound interest, and that is coming right up.

Need a terrible mnemonic that might help you remember the difference between APR and APY?

APR for Really flat interest.

APY for Yeet that interest into the sun.

Since APR is flat (or simple) interest. It is straightforward to calculate. Just take your principal investment and multiply it by the APR (as a decimal) to get what you will earn in a year. For example with an initial 1k investment earning 10% a year you would earn 100 dollars a year (1,000 * .1 = 100). Since APR only requires multiplication and division it intuitively makes sense to most people to estimate how much money they will earn in half a year, a month, a day, and so on.

However, just because APR is intuitive does NOT mean APY is intuitive. Humans are notoriously BAD at estimating exponential growth in our heads. APR we are good at. APY? Not so much. I’ll prove it to you with a question. When I first heard the following example I grossly underestimated the answer. Math nerds: I’m sorry, this is technically a geometric growth example rather than exponential, but I’ll use it anyway.

Imagine you start with a piece of paper. Each time a bell rings you add double the number of papers on your desk. So you start with one, hear the bell and add two, then hear the bell and add 4, and so on. After the bell rings 50 times how high will your stack of paper be?

Stop and make your guess, then continue reading… would your paper stack be as thick as one of Brandon Sanderson’s books? Would it be as tall as a person? Would it be higher than the empire state building?

In fact, it would reach far above the atmosphere of the earth, cross Venus’ orbit, and almost reach the surface of the sun. Wow.

So what does that mean? It means compounding is darn powerful. So yes, I would always recommend compounding your interest unless you need the money immediately.

It also means that without a graphing calculator or a spreadsheet you’re going to be sorely wrong at trying to estimate APY in your head. So let’s take the assumptions you have about APY and throw them out starting with this… you can’t use APY to estimate your daily return. Most beginning yield farmers (and yes, I made this mistake too) look at the promised APY of a farm, compare it to what they made that day, then think they’ve been lied to because their daily return is so low compared to the APY.

For example, let’s say the reward for a given liquidity pool is 365% APY, so since there are 365 days in a year to make 365% in a year you should make 1% per day right? WRONG. This common mistake comes from assuming that APY is linear. APY/365 will never be equal to your daily return because APY is exponential and APR is linear.

Daily return ≠ APY/365. No linear shortcuts. Image by JeremyDefiDance

You can’t take a straight line shortcut from the beginning up to the top of the exponential curve. If you want to know your daily return, you’ll have to divide the APR by 365, NOT the APY. You’ll only achieve the APY as a function of time and how long you let your money compound. So how DO you calculate your return over time?

Calculating your compounded return (the easy way)

There is a simple method to estimate compounded returns called the Rule of 70. The Rule of 70 tells us how long it will take to double your money through compounding using a one-step calculation. Anyone can do it using a simple calculator (or in your head if you are good at math).

The rule of 70 is extremely helpful because it takes a complicated math equation and substitutes it for a very good approximation. To see how long it will take your money to double all you have to do is take the number 70 and divide it by the APR (expressed as a percentage).

The Rule of 70. Image by JeremyDefiDance

In the above example, it will take 1.55 years to double your money if you are earning a 45% APR. To calculate this we take 70 and divide it by 45 giving us 1.55. Why is 70 the magic number? I’m not sure honestly, but Khan Academy does a great job at explaining the math behind this though they use the rule of 72 because of much slower compounding periods.

Calculating your compounded return (the hard way)

Want to know exactly what you will earn after any given period of time? Behold, the mighty compounding formula. Note that this formula gives you the future value of an investment rather than what you will earn. If you just want to solve for what you will earn you’ll have to subtract your principle “P” at the end.

Compounding formula with typical DeFi fees included. Image by JeremyDefiDance

Now let’s take the above formula and use it in an example. The most common mistakes are usually formatting errors or using the wrong numbers for r and n.

Example: A user deposits 1,000 dollars principle into an autocompounding vault with a 45% APR. This farm compounds 24 times a day and takes a 2.9% fee. There are no deposit or withdrawal fees. How much will the user have after 90 days?

Now, let’s separate the problem out into the variables.

  • A is what we are solving for
  • P is equal to 1,000 because the user deposited 1,000 dollars
  • F₁ is equal to 0 since the vault doesn’t charge deposit or withdrawal fees
  • r is 0.00123. Wait — what? Isn’t r equal to 45%? Not quite. Since r needs to be expressed as a decimal r would be 0.45 if t was in years. But since t is in days we need to divide 0.45 by 365. So 0.45/365 = 0.00123
  • n is equal to 24 since the vault compounds 24 times a day. If you wanted the express t in years then you would need to use 24*365 or n = 8760 for the number of compounds per period. Be mindful of whether you want t in days, months, or years and make sure n and r are also expressed accordingly
  • f₂ is equal to 0.029 since there is a 2.9% performance fee and f₂ needs to be expressed as a decimal
  • t is equal to 90 because we want to calculate the return after 90 days

Put this all into a graphing calculator with the correct order of operations and the answer is 1113.75

Didn’t get the right answer? No worries, I’ve made some tools that should help if you still want to play with the numbers.

Free Online APR/APY Graphing Calculator

If you want to see this equation visually I’ve gone ahead and made an online APY graphing calculator you can use to enter in your own variables and compare APR vs. APY and experiment with the curves. You can use sliders to adjust any of the variables.

There are some slight changes to help with ease of use. On the web graphing calculator I’ve changed the name of variable F₁ to be d to represent deposit and withdrawal fees (can’t use subscript for variables there). I also have the user enter the APR into variable R expressed as a percentage since it’s easier that way. Check it out, you may learn a few things playing with the sliders.

Tip for ease of use: if you start changing P or get into extreme APR cases you’ll need to manually adjust the X and Y-axis rather than using the default zoom. Just click graph settings in the top right corner to do so.

Free Online APY Spreadsheet

More of a spreadsheet person? Great, I’ve got something for you too.

This spreadsheet works similarly in that you’ll need to enter in all your variables including your APR, principal amount invested, and the compounds per day. You can either use the “Row Independent” page to forecast out any number of days or by using the “Row Dependent” page to get forecasts based on the current values. This “Row Dependent” page allows for the flexibility of adding money, removing money, or if you’d like to track dollar amounts rather than LP amounts.

The spreadsheet isn’t perfect, but should get you started.

The Disappointment of APY

Now that we know the math behind APR and APY, we need to talk about the reality of DeFi. In most cases, you are simply never going to realize the promised APY of any liquidity farm. The APR will almost always fall and will of course bring down the APY as well (since APY is just a formula based on compounding the APR).

But why does APR fall? To understand this, we need to understand where your reward (often stated as the APR) is coming from in the first place. So… where DOES the reward money in DeFi come from? The answer is trading fees and incentives. You’ll see those two words pop up again later so watch for them.

However, there is no such thing as free money, so who is providing the trading fees and incentives and why would they want to do that?

It all comes down to decentralized exchanges. Now decentralized exchanges are NOT charitable organizations, they are in DeFi to make money. They do so by facilitating trades and taking a small percentage of each trade. Therefore the more trades that come through their exchange the more money they get. They want volume to earn more trading fees. The best way to bring in trade volume is to provide good trading fills. And the best way to provide good fills on trades is through lots and lots liquidity.

For example, a trader looking to buy a million dollars worth of BTC is not going to go to a DEX who only has half a million dollars in BTC liquidity pairs. This would cause a massive local price spike of BTC on that market and the trader would receive fewer BTC (therefore losing money) than if they traded on a platform with higher liquidity. So the race to get liquidity begins. This is where YOU come in. Each DEX wants as much liquidity as they can get, and you have it.

To encourage you to provide liquidity on their platform they generally do two things. First, they share a portion of the trading fees with you. The higher the trade volume the more trading fees you (and the DEX) will earn. However, decentralized exchanges will often choose to incentivize particular pairs as well. They provide you with their house token or reward token at a fixed rate per block (blockchain is measured in blocks, but tightly correlates with time).

The key here is that everyone shares the trading fees and the incentives. Since everyone shares from the same generally fixed basket of trading fees and incentives, your slice of the pie gets smaller and smaller as more people join.

The APR will fall as more people join since the reward is being split up between more users.

The image above shows the relationship between APR and liquidity. As more people join, the APR falls because the trading fees and incentives are divided between more and more people.

However, the influx of new participants isn’t the only reason your APR will fall. Any change in the trading fees and incentives will also change your APR. I’ll refer to these two parts (the trading fees and incentives that make your APR) as the APR Mix.

Mechanics of Paying out your APR

Something that most people don’t understand is the actual mechanics of how your APR mix is paid out. Let's talk about that. Your trading fees are paid out by directly increasing the value of your LP amount. So your LP token amount will stay the same, but increase in value as trading fees go into them.

Incentives on the other hand either pile up in the protocol until you harvest them and compound them back into your LP, or are harvested and compounded for you using a service like KogeFarm.io. Auto compounders do the work for you, but make it harder to “see” your incentives being paid out. The way you can tell you are getting incentives is by watching your number of LP tokens grow in number.

Trading fees do not change your number of LP tokens. Instead they increase the value of you existing LP tokens. Compounding incentives increase the number of LP tokens you hold.

Trade Volume and APR

Changes in trading fees make sense to most people. More people trading your pair leads to more trading fees which leads to a higher APR. Lower volume on your pair and you’ll receive less trading fees and a lower APR. However, in most DeFi pools I’ve come across, incentives make up a greater percentage of your APR mix and therefore have greater sway on your APR. While trading fees are paid out “in-kind,” incentives are not. In-kind means you receive the same thing you are lending — like receiving more btc-eth because you are lending btc-eth. When receiving trading fees the value of your LP grows, rather than increasing the number of your LP tokens you hold. Since incentives are not paid out in-kind sometimes the value of your return can swing wildly.

Reward Token and APR

When you receive an incentive for providing liquidity you are promised a fixed rate of rewards. Therefore decreases in the price of your reward token will pull down your APR. If your reward is 100 tokens your reward will remain at 100 tokens even if the price of the token falls by 50%. Ouch, your APR just got sliced in half because of the price of the incentive token.

Reward Token Quality

So what do you do about it? If you want to have a sustainable APR and therefore achieve close to the promised APY, you need to think about the quality of the protocol and the quality of the reward tokens. Will people continue to trade using this DEX so that you continue gaining trading fees? And perhaps more importantly, will the price of their reward token remain somewhat stable? So you need to pick a quality protocol and a quality reward token. So, what makes a quality reward token? Two things: low emissions and high utility.

Emissions

Emissions are the rate at which reward tokens are being given out, or “emitted.” High emissions inflate the supply and decrease the price. Low emissions have much lower inflation and don’t decrease the price of the reward token as much. High emissions allow for high APR farms, however, their price (and the APR) usually won’t last. Low emission farms normally result in low APR farms with more stable prices. So look at how many tokens are emitted a day in comparison to the total supply. Is it 1% (ouch) or 0.1% (better).

This doesn’t mean protocols that use high emission reward tokens are bad, it just means that you may need to move your liquidity to a different farm once the APR has fallen below a competitive level. However, this strategy requires more maintenance since you constantly need to be checking that the APR hasn’t fallen too much. With these types of tokens, I avoid farming LP pairs including the actual reward token because the token is probably on a mission to zero and I’d rather not expose my initial investment up to that possibility as well.

Utility

What most people don’t understand is that in most cases the primary utility of a reward token IS to be sold to provide a reward. Aka, it is designed from the very beginning to go to zero. This is fine if you are just going to sell it as a reward token to achieve an APR/APY. However, if you are considering investing in it directly you should only do so if you see a solid use case beyond being sold. I don’t care how many diagrams, charts, and pyramids you draw — if the protocol isn’t providing an important service and the tokenomics don’t tie the two together — then the protocol’s reward token is probably going to zero.

So take some time and read the tokenomics. Is the token’s value directly tied in some way to the value of the protocol? Is the protocol providing a valuable service? Will it be worth anything in one year or is it designed to go to zero? I don’t usually farm reward tokens directly, however, there are a few quality reward tokens that “evolve” by gaining enough utility that I will consider farming them directly even though they will also be used to pay out my APR.

Conclusion

Turning your APR into APY is all about math. The APR, the fees, and the number of compounds a day are all variables that change how exponential your APY curve will be. However, achieving that exponential line will come down to the success of the underlying protocol you have chosen. If the growth starts to taper off, then just choose a different one. I can’t tell you which protocols reward tokens will last and which won’t, but I do know that KogeFarm’s autocompounding service has all the best options you could want to choose from. The community votes on which vaults to add so if there is a good protocol out there it probably has been discovered and voted on by the KogeFarm community.

KogeFarm auto compounds your liquidity positions for you 24 times a day with the lowest fees I know of in the yield optimizing space. It charges a 2.9% performance fees (you make a dollar, it takes 2.9 cents) and does not charge any deposit or withdrawal fees. There are no lockup periods either. It is currently available on Polygon, Fantom, and Moonriver with an upcoming expansion to Binance Smart Chain and Harmony.

If you put two auto compounding services together it doesn’t matter what the reported APY or APR is — because when used to compound the same farm — the compounder with the lowest fees and highest compounds a day will always win.

So good luck finding sustainable APR’s that you can turn into APY’s through compounding. Don’t get down on yourself because the APR is “only” 10%. You’ll feel better once you remember what your bank's savings account rate is.

If you have any questions about something I’ve written in this article please let me know by highlighting and commenting on the section you have a question about. I’ll be happy to clarify anything.

--

--