# Max Vaults APY Calculation

#### **APY Calculation**

The APY for Max Vaults and underlying strategies represents its annualized performance based on a trailing 7-day and 31-day period of on-chain data. This provides a current, data driven measure of the products recent performance.

{% hint style="info" %}
The example below is based on the trailing 7-day APY calculation. The same calculation is applied to the trailing 31-day APY by changing the time parameter to 31 days. We only display the trailing 31-day APY for Max Vaults. Max Vault strategies display trailing 7-day APY data.
{% endhint %}

The calculation relies on the **rate** that each strategy’s *provider* contract publishes (e.g., `getRate(asset)`).

1. **On-chain exchange rates**

   Our system reads a strategy's exchange rate directly from its smart contract. The rate is captured at two points in time:

   * The rate from the latest block (`R_now`).
   * The rate from a block approximately 7 days prior (`R_7d-ago`).
2. **Calculate the 7-Day Period Return**

   Two rates are used to calculate the strategy's raw percentage gain over the \~7 day period.

$$
R=\frac{R\_{\text{now}}}{R\_{\text{7d-ago}}}−1
$$

3. **Annualized return**

   The below calculation is used to project this 7-day return over a 365-day horizon to calculate the APY for the strategy. This shows what the return would be over a full year if the performance of the last 7 days were to continue.

   A standard periodic compounding formula for is used for this projection:

$$
\text{APY}\_{7\text{d}} ;=; \Bigl(1+R\Bigr)^{;31,536,000/\Delta t}-1
$$

{% hint style="info" %}
Where `31,536,000` is the number of seconds in a year.

And `Δt` is the precise number of seconds that elapsed between the two blocks measured.
{% endhint %}

4. This process updates hourly, so the APY always reflects the most recent 7-day and 31-day performance data.


---

# 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://docs.yieldnest.finance/protocol-design/max-vaults/max-vaults-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.
