# Fees

Onyx is designed to flexibly handle bespoke fee structures.

The current standard `FeeHandler` implementation described below may be expanded to facilitate further use cases.

## Configuration

### Fee types

The current `FeeManager` implementation supports four fees:

* management fee (custom logic)
* performance fee (custom logic)
* entrance fee (flat %)
* exit fee (flat %)

All values are updatable.

### Fee recipients

Each fee can be directed to any arbitrary **fee recipient**.

If no fee recipient is set for entrance or exit fee (i.e., `address(0)`), the fee will be burned, effectively distributing the fee pro-rata to all share holders.

All fee recipients are updatable.

### Fee asset

All fees are distributed in the **fee asset** (e.g. USDC) set on `FeeManager`.

Fee asset is updatable.

## Settlement

Management fee and performance fee are *always* settled during the [share value update](/onyx-protocol/general-flows/share-value-update.md) flow. Management fee is settled prior to performance fee, so that performance fee takes into account the settled management fee.

Entrance and exit fees *can* be settled during deposit and redeem flows (the deposit/redeem handler decides whether to invoke the fee).

### Tracking owed fees

Settled fees are not immediately distributed, but are tracked as debts, which are asynchronously distributed at a later time.

Fee debts are stored per user, quoted in the [**value asset**](/onyx-protocol/architecture/share-value.md#value) (rather than the **fee asset**).

## Distribution

Fees are distributed in the **fee asset** set on `FeeManager`.

Owed fees are converted from the **value asset** to an amount of the **fee asset** at the time of distribution, using the **asset rate** provided by `ValuationHandler`.

There must be enough **fee asset** available in `Shares` . If there is not, then an external wallet must transfer the shortfall to `Shares`.

Distribution is triggered:

* per user
* at any time
* by an `admin`&#x20;

## Fee Settlement and Distribution Flows

See [Fee Settlement](/onyx-protocol/general-flows/fee-settlement.md)

## **Important notes for management and performance fees**

* If migrating value and shares to Onyx from another vehicle, do not add any fees until:
  1. all Onyx shares have been minted
  2. share value has been set in `ValuationHandler`&#x20;
* Updating individual fee config (e.g., a rate) does not automatically settle fees since the previous settlement. The latest config will always be used during settlements. If desired, settle fees using the previous config prior to updating.


---

# 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.enzyme.finance/onyx-protocol/architecture/fees.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.
