> For the complete documentation index, see [llms.txt](https://reports.immunefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reports.immunefi.com/alchemix-v3/56348-sc-insight-incorrect-apy-calculation-in-mytstrategy-approxapy-causes-underreported-yields.md).

# 56348 sc insight incorrect apy calculation in mytstrategy approxapy causes underreported yields

**Submitted on Oct 14th 2025 at 20:05:31 UTC by @Gakarot for** [**Audit Comp | Alchemix V3**](https://immunefi.com/audit-competition/alchemix-v3-audit-competition)

* **Report ID:** #56348
* **Report Type:** Smart Contract
* **Report severity:** Insight
* **Target:** <https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/MYTStrategy.sol>
* **Impacts:**

## Description

## Brief/Intro

`MYTStrategy::_approxAPY()` incorrectly divides the squared APR term by 2 \* SECONDS\_PER\_YEAR, instead of just 2, effectively nullifying compounding growth in APY approximation. This leads to misreported yield rates across strategies.

## Impact Details

APY and APR become near identical, misleading users and allocators relying on the `snapshotYield()` results for decision making or display.

## References

Link to Code ---> <https://github.com/alchemix-finance/v3-poc/blob/b2e2aba046c36ff5e1db6f40f399e93cd2bdaad0/src/MYTStrategy.sol#L230-L234>

## Mitigation

To correct the APY miscalculation, the squared APR term should not be divided by SECONDS\_PER\_YEAR. The denominator should only be 2, restoring the correct compounding approximation formula. Specifically, in `MYTStrategy::_approxAPY()`, replace:

```solidity
-return apr + aprSq / (2 * SECONDS_PER_YEAR);
+return apr + aprSq / 2;
```

## Proof of Concept

## Proof of Concept

* Paste this test in file location: v3-poc/src/test/MYTStrategy.t.sol
* Runnable Command: MAINNET\_RPC\_URL="<https://eth-mainnet.g.alchemy.com/v2/YOUR\\_KEY>" forge test --mt test\_POC\_IncorrectAPYCalculation -vvvvv
* Note: This PoC runs on a local Foundry mainnet fork using a read only Alchemy RPC key.

```solidity
function test_POC_IncorrectAPYCalculation() public view {
        // Setup a base per-second rate that equals roughly 5% APR
        uint256 ratePerSecWad = 1.585e9; // 0.05 / 31_557_600 * 1e18

        // Simulate what snapshotYield() would call internally
        uint256 secondsPerYear = strategy.SECONDS_PER_YEAR();
        uint256 apr = ratePerSecWad * secondsPerYear;
        uint256 aprSq = (apr * apr) / 1e18;

        // Buggy formula used in strategy
        uint256 buggyApy = apr + (aprSq / (2 * secondsPerYear));

        // Correct compounding approximation
        uint256 correctApy = apr + (aprSq / 2);

        console.log("Proof of Incorrect APY Calculation");
        console.log("Base APR (should be ~5%):", apr);
        console.log("Buggy APY (contract formula):", buggyApy);
        console.log("Correct APY (mathematical):", correctApy);

    }
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://reports.immunefi.com/alchemix-v3/56348-sc-insight-incorrect-apy-calculation-in-mytstrategy-approxapy-causes-underreported-yields.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
