> For the complete documentation index, see [llms.txt](https://zupprotocol.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zupprotocol.gitbook.io/documentation/technical/yield-calculation.md).

# Yield Calculation

## Calculating 24h Yearly Yield

Calculating the 24h yield of a liquidity pool is simple math. First, divide its 24h fees by its TVL, then multiply by 100 to get the yield as a percentage (this gives you the literal 24h yield). Finally, multiply by 365 to get the yearly yield

$$
x = (\frac{y}{z} \times{100})\times {365}
$$

$$
\text{24h Yearly Yield} = (\frac{\text{24h Fees USD}}{\text{TVL USD}} \times{100}) \times{365}
$$

## Calculating X Days yearly Yield

Calculating a yearly yield for more than 24 hours (or for multiple days) is a bit more complex than calculating the 24h yearly yield. In this case, we use the average to obtain a more accurate yield

1. You must first calculate the 24h yearly yield for each day (e.g., for 30 days) using the same formula above
2. Now, calculate the average of all the yields by summing them up and dividing by the number of days (e.g., 30).
3. Done! You now have a precise average yearly yield based on data from several days

$$
x =\frac{\sum\_{i=0}^{n}{((\frac{y\_i}{z\_i}\times{100})\times{365})}}{n}
$$

$$
\text{X Days Yearly Yield} =\frac{\sum\_{i=0}^{n}{((\frac{\text{Day 24h Fees USD}\_i}{\text{Day TVL USD}\_i}\times{100})\times{365})}}{n}
$$


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://zupprotocol.gitbook.io/documentation/technical/yield-calculation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
