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

# FeeVault

> Fee accrual, reporting, and distribution for vault guardians and operators

## Overview

`FeeVault` manages fee accrual and distribution for Aera V3 vaults. Fees accrue over time based on vault performance and are calculated by a dedicated fee calculator contract -- `DelayedFeeCalculator` for single-depositor vaults or `PriceAndFeeCalculator` for multi-depositor vaults.

The guardian or fee recipient can claim accrued fees, but cannot manipulate the fee calculation itself. Fee accrual uses time-delayed or snapshot-based mechanisms to prevent manipulation through timing. The vault owner configures fee parameters and recipient addresses.

For the conceptual model of how fees work in the Aera V3 protocol, see [Curation](/guides/concepts/curation) and [Security](/guides/concepts/security).

## Functions

### reportFees

Reports the current fee state to the vault. Called by the guardian or fee calculator to update accrued fee amounts based on the latest vault value.

**Signature:**

```solidity theme={null}
function reportFees(uint256 vaultValue) external
```

| Parameter    | Type      | Description                             |
| ------------ | --------- | --------------------------------------- |
| `vaultValue` | `uint256` | Current vault value for fee calculation |

### claimFees

Claims accrued fees for the caller. The fee recipient can withdraw their accrued fees from the vault.

**Signature:**

```solidity theme={null}
function claimFees(address token, uint256 amount, address recipient) external
```

| Parameter   | Type      | Description                         |
| ----------- | --------- | ----------------------------------- |
| `token`     | `address` | Token address to claim fees in      |
| `amount`    | `uint256` | Amount of fees to claim             |
| `recipient` | `address` | Address to receive the claimed fees |

### setFeeRecipient

Sets the address that receives guardian fees. Only callable by the vault owner.

**Signature:**

```solidity theme={null}
function setFeeRecipient(address recipient) external
```

| Parameter   | Type      | Description                      |
| ----------- | --------- | -------------------------------- |
| `recipient` | `address` | Address of the new fee recipient |

### accruedFees

Returns the total accrued fees available for claiming.

**Signature:**

```solidity theme={null}
function accruedFees() external view returns (uint256)
```

### feeRecipient

Returns the current fee recipient address.

**Signature:**

```solidity theme={null}
function feeRecipient() external view returns (address)
```

## Events

### FeesReported

Emitted when fees are reported to the vault.

```solidity theme={null}
event FeesReported(uint256 vaultValue, uint256 feesAccrued)
```

### FeesClaimed

Emitted when accrued fees are claimed.

```solidity theme={null}
event FeesClaimed(address indexed token, uint256 amount, address indexed recipient)
```

### FeeRecipientSet

Emitted when the fee recipient is updated.

```solidity theme={null}
event FeeRecipientSet(address indexed recipient)
```

## Errors

### FeeVault\_\_InsufficientFees

Thrown when a claim exceeds accrued fees.

```solidity theme={null}
error FeeVault__InsufficientFees()
```

### FeeVault\_\_NotAuthorized

Thrown when an unauthorized address attempts a fee operation.

```solidity theme={null}
error FeeVault__NotAuthorized()
```

## Inheritance

`FeeVault` is typically composed alongside a vault rather than inherited directly:

* [BaseVault](/contract-reference/base-vault) uses `FeeVault` for fee accounting
* `DelayedFeeCalculator` -- Time-delayed fee calculation for single-depositor vaults
* `PriceAndFeeCalculator` -- Unit-based fee calculation for multi-depositor vaults

See [Periphery](/contract-reference/periphery) for fee calculator contract details.

<Info>
  This page was manually created as a baseline. Run the [contract reference generation pipeline](/contract-reference/overview#generation-pipeline) to update with complete NatSpec documentation from the Solidity source.
</Info>
