# 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.

> ℹ️ 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.

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.

1. **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:

> ℹ️ 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.

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