# IBaseFeeCalculator

Base interface for a contract that calculates TVL and performance fees for a vault and protocol

## Functions

### setProtocolFeeRecipient

Set the protocol fee recipient

```solidity
function setProtocolFeeRecipient(address feeRecipient) external;
```

**Parameters**

| Name           | Type      | Description                               |
| -------------- | --------- | ----------------------------------------- |
| `feeRecipient` | `address` | The address of the protocol fee recipient |

### setProtocolFees

Set the protocol fee rates

```solidity
function setProtocolFees(uint16 tvl, uint16 performance) external;
```

**Parameters**

| Name          | Type     | Description                              |
| ------------- | -------- | ---------------------------------------- |
| `tvl`         | `uint16` | The TVL fee rate in basis points         |
| `performance` | `uint16` | The performance fee rate in basis points |

### setVaultFees

Set the vault-specific fee rates

```solidity
function setVaultFees(address vault, uint16 tvl, uint16 performance) external;
```

**Parameters**

| Name          | Type      | Description                              |
| ------------- | --------- | ---------------------------------------- |
| `vault`       | `address` | The address of the vault                 |
| `tvl`         | `uint16`  | The TVL fee rate in basis points         |
| `performance` | `uint16`  | The performance fee rate in basis points |

### setVaultAccountant

Set the accountant for a vault

```solidity
function setVaultAccountant(address vault, address accountant) external;
```

**Parameters**

| Name         | Type      | Description                       |
| ------------ | --------- | --------------------------------- |
| `vault`      | `address` | The address of the vault          |
| `accountant` | `address` | The address of the new accountant |

## Events

### VaultFeesSet

Emitted when a vault's fees are updated

```solidity
event VaultFeesSet(address indexed vault, uint16 tvlFee, uint16 performanceFee);
```

**Parameters**

| Name             | Type      | Description                                  |
| ---------------- | --------- | -------------------------------------------- |
| `vault`          | `address` | The address of the vault                     |
| `tvlFee`         | `uint16`  | The new TVL fee rate in basis points         |
| `performanceFee` | `uint16`  | The new performance fee rate in basis points |

### ProtocolFeeRecipientSet

Emitted when the protocol fee recipient is updated

```solidity
event ProtocolFeeRecipientSet(address indexed feeRecipient);
```

**Parameters**

| Name           | Type      | Description                               |
| -------------- | --------- | ----------------------------------------- |
| `feeRecipient` | `address` | The address of the protocol fee recipient |

### ProtocolFeesSet

Emitted when protocol fees are updated

```solidity
event ProtocolFeesSet(uint16 tvlFee, uint16 performanceFee);
```

**Parameters**

| Name             | Type     | Description                                           |
| ---------------- | -------- | ----------------------------------------------------- |
| `tvlFee`         | `uint16` | The new protocol TVL fee rate in basis points         |
| `performanceFee` | `uint16` | The new protocol performance fee rate in basis points |

### VaultAccountantSet

Emitted when the accountant for a vault is updated

```solidity
event VaultAccountantSet(address vault, address accountant);
```

**Parameters**

| Name         | Type      | Description                                                |
| ------------ | --------- | ---------------------------------------------------------- |
| `vault`      | `address` | The address of the vault whose accountant is being updated |
| `accountant` | `address` | The address of the new accountant assigned to the vault    |

## Errors

### Aera\_\_TvlFeeTooHigh

Thrown when attempting to set an TVL fee higher than the maximum allowed

```solidity
error Aera__TvlFeeTooHigh();
```

### Aera\_\_PerformanceFeeTooHigh

Thrown when attempting to set a performance fee higher than the maximum allowed

```solidity
error Aera__PerformanceFeeTooHigh();
```

### Aera\_\_ZeroAddressProtocolFeeRecipient

Thrown when attempting to set a protocol fee recipient to the zero address

```solidity
error Aera__ZeroAddressProtocolFeeRecipient();
```

### Aera\_\_CallerIsNotVaultOwner

Thrown when attempting to set vault fees for a vault that is not owned by the caller

```solidity
error Aera__CallerIsNotVaultOwner();
```

### Aera\_\_CallerIsNotVaultAccountant

Thrown when attempting to perform an action on a vault by someone who is not its assigned accountant

```solidity
error Aera__CallerIsNotVaultAccountant();
```

### Aera\_\_VaultNotRegistered

Thrown during a vault is not registered and action requires a registered vault

```solidity
error Aera__VaultNotRegistered();
```


---

# 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.aera.finance/the-protocol/core/ibasefeecalculator.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.
