# How is APY Calculated

** How is Upfund's APY (Annual Percentage Yield) calculated?**

APY is computed based on how long it takes to return the money, and how much it earns in that time, extrapolated over a year. Because each loan has multiple payments, each payment essentially will have it's own separate APY. We then combine all the APYs to compute the total APY on the entire investment.

**Below is a mathematical explanation with an example, of how it works. Proceed with caution :)**

For example, let's say that a campaign is paying back 5% ROI, and returns the investment over 3.5 months

**The wrong way:**

If you took the first, easy way out, you'd assume the APY for such a deal should be (5% * (12/3.5)) = ~17%. The problem is though, this assumes the entire loan is being paid back after 3.5 months, which is not the case. The loan is paid back in chunks, starting at 2 months.

**The right way**

In the first 1.5 months, there are no payments.

At the 2 month mark (60 days later), the first payment is made, which is 10% of the principal. For this partial sum, the APY is computed as follows:

**p1 = 5% / 60 * 365 = 30% APY**

==> This means that the first payment, which happens at the 60 day mark, has an APY of 30%.

At the 2.5 months mark (75 days later), the second payment is made, 30% of the principal. For this partial sum, the APY is computed as follows:

**p2 = 5% / 75 * 365 ****= 24% APY**

==> This means that the second payment, which happens at the 75 day mark, has an APY of 24%.

At the 3 month mark (90 days later), the 3rd payment is made, another 30% of the principal. For this partial sum, the APY is computed as follows:

**p3 = 5% / 90 * 365 = 20% APY**

==> This means that the first payment, which happens at the 90 day mark, has an APY of 20%.

At the 3.5 month mark, the last payment is made, 35% of the principal. For this partial sum, the APY is computed as follows:

**p4 = 5% / 105 * 365 = 17% APY**

The final APY is then calculated using a weighted average:

**(p1 * 10 + p2 * 30 + p3 * 30 + p4* 35) / 105 = 22% APY**