> For the complete documentation index, see [llms.txt](https://maplefun.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maplefun.gitbook.io/docs/core-mechanics/how-rewards-are-calculated.md).

# How Rewards Are Calculated

### Overview

Maple pools do not use token emissions or periodic payouts. Instead, rewards are automatically reflected in the exchange rate. This increases the amount of underlying assets each share can redeem. Your profit comes simply from the growth of your share value over time..

* Your share balance only changes when you deposit (mint shares) or withdraw (burn shares).
* Your value changes when the pool's assets per share increases.

***

### Key Concepts

**Total Assets (TVL)** The pool's current balance of the underlying asset. For native SOL pools, this is the pool account's lamport balance minus rent-exempt minimum. For token pools, this is the vault's token balance.

**Total Supply** The total number of shares issued by the pool (tracked via the Token-2022 shares mint).

**Exchange Rate** The ratio of total assets to total shares, representing how many underlying assets each share can claim:

```
exchangeRate = totalAssets × 1e18 / totalSupply
```

**Your Ownership** Your share of the pool's assets:

```
yourAssets = yourShares × totalAssets / totalSupply
```

***

### How Deposits Work

When you deposit, the vault:

1. Measures assets before your deposit
2. Receives your deposit (SOL or SPL tokens)
3. Computes a dynamic deposit fee based on TVL tiers and any time-based discounts
4. Mints shares based on your net contribution after fees

**Share Calculation:**

```
netDeposit = depositAmount - depositFee
sharesMinted = netDeposit × totalSupply / totalAssets
```

The deposit fee stays inside the pool, slightly increasing assets per share for existing holders.

**Deposit Restrictions:**

* Shares are non-transferable (Token-2022 NonTransferable extension)
* You can only deposit to your own address
* Optional anti-whale cap may limit deposit size relative to current TVL
* Deposits blocked if pool has leftover assets with zero share supply (dust protection)

***

### How Withdrawals Work

When you withdraw, you burn shares and receive underlying assets minus applicable fees:

**Gross Redemption:**

```
grossAssets = yourShares × totalAssets / totalSupply
```

**Deductions:**

* **Withdrawal Fee:** Stays in the pool, benefiting remaining holders
* **Project Fee:** Split 50/50 between the platform and pool creator (leaves the pool)
* **Early-Withdraw Penalty:** If withdrawing before the cooldown period ends, a penalty stays in the pool

**Net Amount Received:**

```
netAssets = grossAssets - withdrawalFee - projectFee - penalty
```

**Reserve Ratio Protection:** The vault enforces a minimum reserve. If your withdrawal would push the pool below this threshold, the transaction reverts.

**Bootstrap Lock:** The pool creator (seeder) cannot withdraw until the bootstrap lock period expires, ensuring initial liquidity stability.

***

### Early-Withdraw Penalty Mechanics

The penalty system encourages longer-term participation:

* **Linear Cooldown:** Penalty starts at `maxWithdrawPenaltyBps` and decays linearly to zero over the `withdrawCooldownSecs` period.
* **Fast-Exit Floor:** An optional minimum penalty (`fastExitFloorBps`) during an initial window (`fastExitWindowSecs`) for very early withdrawals.

The vault applies whichever penalty is higher, not both combined.

***

### Reward Estimation (Backend)

The backend tracks exchange rate snapshots over time to calculate estimated rewards:

* **Snapshots:** Collected periodically based on pool activity
* **Calculation:** Compares current exchange rate to historical values
* **Timeframes:** 7-day, 30-day, and since-inception estimates are computed

**Important:** Displayed reward estimates reflect pool-level exchange rate growth. Your personal outcome also depends on the fees you paid on entry and exit, and how long you held your position.

{% hint style="info" %}

#### The 'Up to \[X]%' rate is a dynamic reward estimate, **not** a fixed APY.

{% endhint %}
