# APY

Supplying liquidity via staking rewards at Gable is subjected to three different annual percentage yields (APY's): ***Staking APY***, ***Interest APY*** and ***Total APY***. This section will explain to you how these APY are derived.

First of all, a 7 day time window is considered when calculating all above mentioned APY. The 7 day yield is subsequently extended to annually.

### Staking APY

The staking APY represents the yield obtained by staking at the Gable validator node. It is calculated using the following formula(s):

$$
TotalStake\_{t, i} = Stake\_{t-i}+StakingRewards\_{t-i}
$$

where 't' is the most recent time, and 'i' is the lag in days.

$$
StakingAPY\_t = \frac{{TotalStake\_{t=0} - TotalStake\_{t-7}}}{{TotalStake\_{t-7}}} \times \left(\frac{{365}}{{7}}\right) \times 100
$$

### Interest APY

The interest APY represents the yield obtained on your staking rewards when you supply them to the Gable liquidity pool. The interest earned from staking rewards is distributed back into the pool, effectively compounding your earnings. The interest APY is calculated using the following formula(s):

$$
TotalEarnings\_{t, i} = StakingRewards\_{t-7}+InterestEarnings\_{t-i}
$$

where 't' is the most recent time, and 'i' is the lag in days.

It is important to note that the StakingRewards component provides a stable reference point by considering its value at 't-7' as a static factor. This allows for consistent and accurate calculations of the Interest APY.

$$
InterestAPY = \left(1 + \frac{{TotalEarnings\_{t=0} - TotalEarnings\_{t-7}}}{{TotalEarnings\_{t-7}}}\right)^{\frac{{365}}{{7}}-1} - 1
$$

### Interest APY

When you stake, you earn staking rewards. By supplying these staking rewards to the pool, you further earn interest on them. This interest can be viewed as a compounding yield on your initial staking rewards.

The Total APY takes into account the growth of your staking rewards through staking and the subsequent interest earned through supplying. This compounding effect results in a higher overall yield on your staked assets.

The Total APY is calculated using the following formula:<br>

$$
TotalAPY = (1 + StakingAPY) \* ( 1 + InterestAPY) - 1
$$


---

# 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.gable.finance/v1-flashloan-pool/staking-liquidity/apy.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.
