# How to Calculate Total APY for a 180 Days Cohort?

Having trouble calculating the total APY in UniFarm? Don’t worry we’ve got your back! We have created this guide after constant iteration based on user input. We hope this helps you better understand the APY calculations on UniFarm. (Refer to this google sheet link)

To begin, we must establish a few assumptions in order to make this easy for any stakeholder, old or new.

Let’s consider a scenario. There are 5 tokens available in the upcoming pool. Here are the token distribution details:

COMPANY | TOKEN | TOKEN PRICE ($) | TOKEN REWARDS | TOKENS STAKED |

Company A | Token A | $1.00 | 45,000 | 180,000 |

Company B | Token B | $0.50 | 90,000 | 360,000 |

Company C | Token C | $0.30 | 150,000 | 600,000 |

Company D | Token D | $0.50 | 90,000 | 450,000 |

Company E | Token E | $1.00 | 45,000 | 225,000 |

Note:When we start the pool, we freeze the dollar value of each token.

The pool is going to last a total of **180 days**.

**What is the Method By Which UniFarm Works?**

Let’s assume that you decide to stake Token A (as an example – for the calculation going forward in this blog).

**WEEK 1: **You exclusively farm Token A.

**WEEK 2: **You farm Token A and Token B.

**WEEK 3:** You farm Token A, Token B, and Token C.

**WEEK 4:** You farm Token A, Token B, Token C, and Token D.

**WEEK 5:** You farm Token A, Token B, Token C, Token D, and Token E.

**How Many Tokens Are You Going to Earn?**

UniFarm provides you with the flexibility to choose which token you would like to begin staking and **farming** within the available pool. As time progresses, you will earn multiple token rewards during the lifetime of the pool.

Assuming that you stake 1800 A tokens.

From Table 1, you can see Company A has contributed 45,000 Tokens to the rewards pool.

The pool is live for 5 projects. So, for the long-term interest, the rewards are distributed equally across each project w.r.t. the timeline of the pool.

*Reward distribution (No. of tokens): 45,000/5 = 9,000*

Now, if you stake Token A, you earn Token A for 180 days. To calculate the daily reward earned, 9,000 must be divided by 180.

*Total Token A’s Daily Reward (No. of tokens): 9,000/180 = 50*

As a consequence, the daily token incentive will be earned by all Token A stakeholder participants, individually.

Note:During the entire duration of the pool, the day you start staking your tokens will be considered the beginning of your staking period.

*Let us now calculate your Stake Ratio*.

Assume you have staked 4000 Token A.

From Table 1: Total Number of Token A staked = 180,000

Note:Divide the number of tokens staked by the total number of TOKEN A staked to get theSTAKE RATIO.

Stake Ratio = No. of Token A Staked by You/Total Token A Staked = 4000/180,000 = 0.0174

**Token A: Your Reward** (From WEEK 1)

From the above calculation we gathered that:

*Reward distribution (No. of tokens): 45,000/5 = 9,000*

*Total Token A’s Daily Reward (No. of tokens): 9,000/180 = 50*

Let us calculate the rewards earned by you on a daily basis:

Your Token A Daily Rewards = Stake Ratio x Total Token A's Daily Rewards = 0.016 x 50 = 0.80

For the next 180 days, your daily Token A reward is **0.80 tokens**.

**From Table 1, we gather that the price of Token A is $1**

Therefore, if you stake Token A for 180 days, you will receive:

Daily reward x Number of Days x Price of the token: 0.80 x 180 x 1 = **$144**

**Token B: Your Reward** (From WEEK 2)

From Table 1, we see that Company B has contributed 90,000 Tokens to the reward pool.

Again, in order to distribute the rewards to each project, we must divide it by 5.

*Reward distribution (No. of tokens): 90,000/5 = 18,000*

Note: Because you earn Token B from WEEK 2, you will earn it for 173 days only.

*Total Token B’s Daily reward (No. of tokens): 18,000/173 = 104.04*

Your Token B Daily Rewards = Stake Ratio x Total Token B's Daily Rewards = 0.016 x 104.04 = 1.665

For the next 173 days, your daily TOKEN B reward is **1.665 tokens**.

From Table 1, we gather that the price of Token B is $0.50

Therefore, if you stake Token B for 173 days, you will receive:

Daily reward x Number of Days x Price of the token: 1.665 x 173 x 0.50 = **$144**

**Token C: Your Reward** (From WEEK 3)

From Table 1, we see that Company C has contributed 1,50,000 Tokens to the reward pool.

Again, in order to distribute this amount to each project, we must divide it by 5.

*Reward distribution (No. of tokens): 1,50,000/5 = 30,000*

**Note**: Because you earn Token C starting in WEEK 3, you will earn it for 166 days only.

*Total Token C’s Daily Reward (No. of tokens): 30,000/166 = 180.72*

Your Token C Daily Rewards = Stake Ratio x Total Token C's Daily Rewards = 0.016 x 180.72 = 2.89

For the next 166 days, your daily TOKEN C reward is ** 2.89 tokens**.

From Table 1, we gather that the price of Token C is $0.30

Therefore, if you stake Token C for 166 days, you will receive:

Daily Reward x Number of Days x Price of the token: 2.89 x 166 x 0.30 = **$144**

## Token D: Your Reward (From WEEK 4)

From Table 1, we see that Company D has contributed 90,000 Tokens to the reward pool.

Again, in order to distribute this amount to each project, we must divide it by 5.

*Reward distribution (No. of tokens): 90,000/5 = 18,000*

**Note**: Because you earn Token D starting in WEEK 4, you will earn it for 159 days only.

*Total Token D’s Daily Reward (No. of tokens): 18,000/159 = 113.20*

Your Token D Daily Rewards = Stake Ratio x Total Token D's Daily Rewards = 0.016 x 113.20 = 1.81

For the next 159 days, your daily TOKEN D reward is ** 1.81 tokens**.

From Table 1, we gather that the price of Token D is $0.50

Therefore, if you stake Token D for 159 days, you will receive:

Daily Reward x Number of Days x Price of the token: 1.81 x 159 x 0.50 = **$144**

**Token E: Your Daily Reward** (From WEEK 5)

From Table 1, we see that Company E has contributed 45,000 Tokens to the reward pool.

Again, in order to distribute this amount to each project, we must divide it by 5.

*Reward distribution (No. of tokens): 45,000/5 = 9,000*

**Note**: Because you earn Token E starting in WEEK 5, you will earn it for 152 days only.

*Total Token E’s Daily Reward (No. of tokens): 9,000/152 = 59.21*

Your Token E Daily Rewards = Stake Ratio x Total Token E's Daily Rewards = 0.016 x 59.21 = 0.95

For the next 152 days, your daily TOKEN E reward is ** 0.95 tokens**.

From Table 1, we gather that the price of Token E is $1

Therefore, if you stake Token E for 152 days, you will receive:

Daily reward x Number of Days x Price of the token: 0.95 x 152 x 1 = **$144**

## How Do You Determine Your Total APY?

Before we begin computing the total APY of the tokens you farmed, there is one thing we need to reiterate —

“When we start the pool, we freeze the DOLLAR value of each token.”

Assume the tokens’ DOLLAR value is locked at the time of pool start.

This is what your reward structure for the pool looks like if you are staking for a period of 180 days:

TOKENS | ($) TOKEN PRICE(a) | REWARDS/DAY(b) | DAYS(c) | TOTAL REWARDS(d) = a*b*c |

Token A | $1.00 | 0.80 | 180 | $144 |

Token B | $0.50 | 1.66 | 173 | $144 |

Token C | $0.30 | 2.89 | 166 | $144 |

Token D | $0.50 | 1.81 | 159 | $144 |

Token E | $1.00 | 0.95 | 152 | $144 |

TOTAL | $720 |

## Key Points

- The number of tokens staked is 4000 (Token A)
- The token has a DOLLAR value of $1.00.
- You staked a total of $4000.
- The total DOLLAR worth of the rewards is $720.

## Your Total APY

APY = (Your Total Reward for 180 days x 2 / Your Total Stake Worth) x 100 = (720 x 2 / 4000) x 100 = 36%

**Note:** Since we are annualizing the yield, your reward is multiplied by 2.

**Your total APY is 36%**

**NOTE**: If the APY falls below the minimum APY that we have promised, we will introduce additional $UFARM tokens after 8 weeks of farming to meet the required APY.

UniFarm is a one-of-a-kind staking solution that brings together the finest projects in DeFi to offer value to investors. UniFarm enables you to invest one token but receive several high-value tokens, thus your returns are automatically diversified in addition to a fantastic APY.

Feel free to refer to the google sheet for detailed information or connect with our lead on twitter.