> ## Documentation Index
> Fetch the complete documentation index at: https://docs.saffron.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Fee Mechanism

> How protocol fees are calculated, minted, and distributed using variableBearerToken during vault settlement.

Protocol fees are collected by minting additional `variableBearerToken` to the vault during settlement rather than deducting from deposits or yields.

* **Fee mint formula:**
  `mintAmount = variableBearerToken.totalSupply() * feeBps / (10000 - feeBps)`

  Rather than deducting fees from earnings, the protocol mints new `variableBearerToken` to itself, diluting existing holders. This formula ensures the protocol ends up with exactly `feeBps` percentage of the final token supply.

  **Example (12.5% fee):**

  * Pre-mint supply: 100 tokens
  * `mintAmount = 100 * 1250 / (10000 - 1250) ≈ 14.29`
  * Post-mint supply: 114.29 tokens
  * Protocol share: 14.29 / 114.29 = 12.5%
  * Depositor share: 100 / 114.29 = 87.5%

* **Fee invariants:**
  * Fee rate is locked per vault at initialization
  * `expectedFeeBps` prevents configuration drift between vault creation and initialization

* **Realization:**
  * Fees accrue to the protocol and are redeemed by the current `feeReceiver()` upon withdrawal

<Info>
  Fee rates are configured by the vault factory owner.
</Info>
