> For the complete documentation index, see [llms.txt](https://learn.apy.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.apy.fun/protocol/staking/pools-maths.md).

# Pools maths

<figure><img src="/files/UIKsISZCO45TWcOjEPHt" alt=""><figcaption></figcaption></figure>

APY is recalculated **every 6 hours** (an **epoch**) from the fees generated by **deposits** and **withdrawals** across pools.\
Each epoch, the protocol computes a reward budget and distributes it to **active pools**.&#x20;

### Inputs (per epoch)

* **Pool fees**:\
  `F_i` = fees generated by pool *i* this epoch\
  `F_total = Σ F_i` (sum over all active pools)
* **Active pools**:\
  `N_active` = number of pools that are **activated** (have met the activation goal)
* **Epoch reward budget** (denominated in $YIELD):\
  `R_epoch` = total $YIELD to distribute this epoch (derived from protocol rules and fee model)

> Inactive pools get **0** this epoch (no APR) until they activate.

***

### Distribution (20/80 rule)

* **Equal share (20%)** — baseline for every active pool:

  ```
  R_equal_per_pool = 0.20 × R_epoch / N_active
  ```
* **Activity share (80%)** — proportional to each pool’s fees:

  ```
  R_activity_i = 0.80 × R_epoch × (F_i / F_total)
  ```
* **Pool i epoch rewards**:

  ```
  R_i = R_equal_per_pool + R_activity_i
  ```

***

### From rewards to APR

Let `TVL_i` be the current staked value in pool *i*.\
APR shown in the UI is the annualized rate implied by the current epoch’s reward pace:

```
epochs_per_year = 365 × 24 / 6 = 1,460
BaseAPR_i = ( Value(R_i) / TVL_i ) × epochs_per_year
```

> **Value(R\_i)** uses the current $YIELD reference price (e.g., TWAP) at calculation time.\
> Displayed APR is an **estimate** and updates every 6 hours.

***

### Boosted APR (with Tips)

If a pool has an active boost from **Tips (SOL)**:

```
BoostedAPR_i = BaseAPR_i × (1 + Boost%)
```

The **Boost%** multiplies whatever the current base APR is.

> Tips **do not** affect activation or lock timers—only the APR once active.

***

### Example (simplified)

* `R_epoch = 100,000 $YIELD`, `N_active = 3`
* Fees this epoch: Pool A `F_A=10`, Pool B `F_B=30`, Pool C `F_C=60` ⇒ `F_total=100`
* Equal share: `0.20 × 100,000 / 3 = 6,666.67 $YIELD` per pool
* Activity share (80,000 $YIELD):
  * A: `80,000 × 10/100 = 8,000` → `R_A = 14,666.67`
  * B: `80,000 × 30/100 = 24,000` → `R_B = 30,666.67`
  * C: `80,000 × 60/100 = 48,000` → `R_C = 54,666.67`
* Convert each `R_i` to APR using each pool’s `TVL_i` and annualize (as above).
* If Pool B has a **+10%** boost, `APR_B` becomes `BaseAPR_B × 1.10`.

***

### Edge cases & notes

* **Just activated:** Rewards for a pool start **next epoch** after activation.
* **Zero fees this epoch:** If `F_total = 0`, the activity share is 0; if `R_epoch` is fee-derived, equal share may also be 0 → APRs show **0%** for that epoch.
* **TVL changes:** APR reflects the **current** TVL at the time of calculation.

**Decimals/rounding:** UI rounds APR to a sensible precision (e.g., 2 decimals).

<figure><img src="/files/azhMPavsGHgRSrmSfEOX" alt=""><figcaption></figcaption></figure>


---

# 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://learn.apy.fun/protocol/staking/pools-maths.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.
