# APY Calculation

APY shown in frontend is calculated using the following formula.

Auto-compound APY

First we deduct fee from APR:

NetAPR=RewardAPR∗(1−fee)

Second, we calculate into APY. We use 365 (daily compound):

NetAPY=(1+NetAPR/365)365−

Then, we include trade APR.

AutocompoundAPY=(1+NetAPY)∗(1+TradeAPR)−1

​

*NOTE:* For Trade APR, we use multiplication here because in auto-compound we grow LP and LP is multiplication of trading APR.

For example:

Net APY = 20%, Trade APR = 10%

Year 0: LP = 100 and 1 LP = 1 Token + 1 UST (Total value is 200 UST)

Year 1: LP = 120 and 1 LP = 1.1 Token + 1.1 UST (Total value is 264 UST)

Year 0-1 Profit = 64 UST

​

We can apply compound APY formula to get the same result:

Compound APY = (1 + Net APY 20%) \* (1 + Trade APR 10%) - 1 = 32%

Investment 200 UST \* 32% = 64 UST

​

Full example for auto-compound APY calculation

Reward APR = 87.57%, Fee = 5%, Trade APR = 4.59%

Net APR = 0.8757 \* (1 - 0.08) = 0.831915

Net APY = (1 + 0.831915 / 365) ^ 365 - 1 = 1.295541

Auto-compound APY = (1 + 1.295541) \* (1 + 0.0459) - 1 + 0.0348 = 140.09%

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.bobafinance.com/protocol/apy-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
