# Fees & high-water mark

> Management and performance fees on a vault, the waterfall that splits them, the locker rebate at token launch, and how fee terms change.

Source: https://docs.degenhive.ai/vaults/fees

A vault charges two fees, both in USDC and both at the daily roll: a yearly management fee on outside capital, and a performance fee on gains above the per-share high-water mark. `HyperVaultFeeRouter` splits each fee between the protocol, data providers, forecasters and the manager. There is no deposit or withdrawal fee.

> [!IMPORTANT]
> These contracts are not deployed yet and not externally audited. Addresses publish at launch on [Network](https://docs.degenhive.ai/network.md).

> **Figure: Performance fee waterfall.** A third-party vault pays the protocol take first and its manager last; the Flagship pays royalties and forecasters first and the protocol last.
>
> At the top, the gross performance fee: perfFeeBps of the gain above the high-water mark. A dashed side branch marks the locker rebate, which starts at token launch and sends 20% of the gross fee to lockers first. The net fee then splits into two columns. Third-party vault, in order: 1. protocol take, default 20% of the fee, to HyperRevenueRouter; 2. data royalties on the rest, per feed, to DataProviderRegistry; 3. forecaster share, min(net × forecastShareBps, what is left), to HyperCrowdPay; 4. everything left to the manager's managerFeeRecipient. Flagship, in order: 1. data royalties to DataProviderRegistry; 2. forecaster share to HyperCrowdPay; 3. everything left to HyperRevenueRouter. A note below: the management fee skips the waterfall; the Flagship sends all of it to HyperRevenueRouter, and a third-party vault splits it into the protocol take and the manager's share.

## The numbers

| Parameter | Bound | Set by |
|---|---|---|
| `mgmtFeeBps` | 0–200 per year | Manager or council at deploy; changes below |
| `perfFeeBps` | 1,000–2,500 | Same |
| `forecastShareBps` | 0–5,000 of the net performance fee | Same |
| Protocol take (`protocolTakeBps`) | 2,000 by default, at most 5,000 | Council, `HyperVaultConfig.setProtocolTakeBps` |
| Data royalty per feed | At most 500 bps of the royalty base | Provider terms, locked at subscribe |
| Data royalties combined | At most 5,000 bps, at most 20 royalty feeds | `DataProviderRegistry` |
| Locker rebate | 2,000 bps (20%) of the gross performance fee, at token launch | Constant `LP_REBATE_SHARE_OF_PERF_BPS` |

Each vault picks its own fees inside these bounds. The Flagship runs 1% and 25%.

## Management fee

The management fee accrues at each roll for every day since the last roll, on the share of NAV held by outside depositors:

`Management fee per roll`

```math
mgmtUsdc = extNav * mgmtFeeBps * daysElapsed / (10,000 * 365)
```

`extNav` is NAV times external shares over total supply. External shares exclude the protocol allocator's shares and the 1 dead share. Everyone else pays it, including the manager's own shares and shares waiting to redeem.

## Performance fee

After the management fee, the roll prices a share. If that price is above the high-water mark, the vault charges `perfFeeBps` on the gain of every share:

`Performance fee per roll`

```math
perfUsdc = (ppsBeforePerf - highWaterMark) * totalSupply * perfFeeBps / 10,000
```

The high-water mark is the highest post-fee share price any roll has set. It is never reset, so a vault that falls must recover all of it before it charges again. The fee is measured once per roll, at the NAV that roll reads.

## The waterfall

The vault sends the management fee and the net performance fee to `HyperVaultFeeRouter`. Third-party and flagship vaults split them differently.

| Leg | Third-party vault | Flagship vault |
|---|---|---|
| Management fee | `protocolTakeBps` to the protocol, the rest to the manager | 100% to the protocol |
| Performance fee, step 1 | Protocol take: `net × protocolTakeBps` | No take |
| Step 2 | Data royalties on what remains | Data royalties on the full net fee |
| Step 3 | Forecasters: `min(net × forecastShareBps, remainder)` | Same |
| Step 4 | The manager gets the rest | The protocol gets the rest |

"Net" is the performance fee after the locker rebate; before the token there is no rebate, so net equals gross. The forecaster cut is a share of the whole net fee, capped by what royalties leave.

Where each leg goes:

- **Protocol** legs go to `HyperRevenueRouter.notifyRevenue`, which splits them across its lanes. See [Revenue](https://docs.degenhive.ai/revenue.md).
- **Royalties** go to `DataProviderRegistry.settleVaultRoyalties`, credited to each royalty feed. See [Data](https://docs.degenhive.ai/data.md).
- **Forecasters** receive theirs through `HyperCrowdPay.fundUsdc(jobId, today, amount)`, into the pot of the vault's `forecastJobId` for the day the fee is paid. See [Bonds and pay](https://docs.degenhive.ai/forecasters/bonds-and-pay.md).
- **Manager** fees go to `managerFeeRecipient`.

## Worked example

A third-party vault runs a 20% performance fee with the default 20% protocol take. It subscribes to one data feed with a 300 bps royalty and pays forecasters 10% (`forecastShareBps` 1,000). One roll finds 50,000 USDC of gain above the high-water mark, after the day's management fee.

Before the token:

| Leg | Calculation | USDC |
|---|---|---|
| Gross performance fee | 50,000 × 20% | 10,000 |
| Protocol take | 10,000 × 20% | 2,000 |
| Royalty base | 10,000 − 2,000 | 8,000 |
| Data royalty | 8,000 × 3% | 240 |
| Forecasters | min(10,000 × 10%, 7,760) | 1,000 |
| Manager | 7,760 − 1,000 | 6,760 |

Depositors keep 40,000 of the 50,000 gain.

At token launch, if every share in the vault qualifies for the full rebate:

| Leg | Calculation | USDC |
|---|---|---|
| Locker rebate to depositors | 10,000 × 20% | 2,000 |
| Net performance fee | 10,000 − 2,000 | 8,000 |
| Protocol take | 8,000 × 20% | 1,600 |
| Data royalty | (8,000 − 1,600) × 3% | 192 |
| Forecasters | min(8,000 × 10%, 6,208) | 800 |
| Manager | 6,208 − 800 | 5,408 |

The management fee on the same vault, with 1,000,000 USDC of outside NAV at 1% a year, is 1,000,000 × 100 / 3,650,000 = 27.40 USDC per day: 5.48 to the protocol and 21.92 to the manager.

Try your own terms:

> **Interactive simulator (HyperVaultFeeRouter fee waterfall):** Management fee `extNav * mgmtBps * days / (10000 * 365)` (mgmt 0..200 bps): Flagship 100% protocol; third-party `protocolTakeBps` (default 2000, max 5000) to protocol, rest to the manager. Performance fee `gain * perfBps / 10000` (1000..2500 bps); at token launch the vault offers 20% of it as an LP rebate and HyperBookRewards takes `offer * rebateShares / totalShares`, the rest is net. Net perf, third-party: take `net * protocolTakeBps`, then data royalties on the rest (max 5000 bps combined), then forecasters `min(net * forecastShareBps, rest)` (max 5000), then the manager gets the rest. Flagship: royalties on net, then forecasters, then the protocol gets the rest. Each protocol payment splits in HyperRevenueRouter: buyback 3167, locker 3166, NFT 500 bps (only while the NFT pot is live), ops the remainder. All steps floor in 6-decimal USDC.

## Locker rebate at token launch

Once `HyperBookRewards` is live, each roll offers 20% of the gross performance fee back to depositors as USDC. `HyperBookRewards` takes the part that belongs to rebate-eligible shares. By default, a depositor whose locked DGV is worth at least 10% of their deposits earns the full rebate on their shares, and at least 5% earns half. Whatever it does not take joins the net performance fee and runs through the waterfall. Depositors claim with `claimUsdcRebate(vault)`. See [Token](https://docs.degenhive.ai/token.md).

Before the token, `HyperBookRewards` is not set and no rebate is offered.

## Changing fee terms

The fee gate is the manager or the council on a third-party vault, and the council alone on a flagship. Cuts are instant. Raises wait 7 days, so depositors can leave first.

```solidity
function setFeePolicy(uint16 mgmtFeeBps, uint16 perfFeeBps) external;  // cuts only, instant
function submitFeePolicy(uint16 mgmtFeeBps, uint16 perfFeeBps, uint16 forecastShareBps, uint64 forecastJobId) external;
function acceptFeePolicy() external;
function revokePendingFeePolicy() external;
function setForecastConfig(uint16 forecastShareBps, uint64 forecastJobId) external;
```

| Change | Path |
|---|---|
| Lower management or performance fee | `setFeePolicy`, instant. Also deletes any pending policy. |
| Raise either fee | `submitFeePolicy`, then `acceptFeePolicy` between 7 and 10 days later |
| Raise the forecaster share, same job | `setForecastConfig`, instant |
| Lower the forecaster share, or switch job while the share is above 0 | `submitFeePolicy` with the 7-day wait |

- `setFeePolicy` with a higher value reverts with `FeeRaiseRequiresTimelock()`.
- `setForecastConfig` with a cut or a job switch reverts with `ForecastCutRequiresTimelock()`. The job must be 1 or bound to this vault (`InvalidForecastJob(jobId)`).
- `acceptFeePolicy` reverts with `TimelockNotReady(validAt)` before day 7, `PolicyExpired(expiredAt)` after the 3-day window, and `NoPendingPolicy()` if nothing is queued.
- A new `submitFeePolicy` replaces the pending one and restarts the clock.

Watch `FeePolicySubmitted(mgmtFeeBps, perfFeeBps, forecastShareBps, forecastJobId, validAt)` to see a raise coming. The read API serves the current and pending policy at `GET /v1/vaults/{vault}/fee-policy`.

## When a fee cannot be paid

Fees are liabilities outside NAV from the moment they accrue. The roll pays them from idle USDC, topped up from the engine's HyperEVM balance. A leg that cannot be paid stays owed and is retried.

- **Retry.** Anyone can call `flushAccruedFees()` on the vault. The next roll also retries.
- **Manager push failed.** The router holds the amount in `pendingManagerFees(recipient)`. The recipient collects it with `claimManagerFees(to)`.
- **Forecaster pot refused.** The router holds it in `heldForecastUsdc(jobId)`. Anyone can call `retryForecast(jobId)` to fund that day's pot.

If several performance fees are owed at once, they are paid under the oldest unpaid epoch and forecast terms.

## Events

```solidity
// HyperVault
event FeesFlushed(uint256 mgmtPaidUsdc, uint256 rebatePaidUsdc, uint256 perfPaidUsdc, uint256 mgmtOwedUsdc, uint256 rebateOwedUsdc, uint256 perfOwedUsdc);
// HyperVaultFeeRouter
event ManagementFeeRouted(address indexed vault, bool isFlagship, uint256 totalUsdc, uint256 protocolUsdc, uint256 managerUsdc);
event NetPerfFeeRouted(address indexed vault, uint64 indexed epoch, uint64 feeDay, bool isFlagship, uint256 totalUsdc, uint256 protocolUsdc, uint256 royaltiesUsdc, uint256 forecastUsdc, uint64 forecastJobId, uint256 managerNetUsdc);
event ManagerFeeDeferred(address indexed vault, address indexed recipient, uint256 amount, uint256 pendingUsdc);
event ManagerFeesClaimed(address indexed owner, address indexed to, uint256 amount);
event ForecastHeld(address indexed vault, uint64 indexed jobId, uint256 amount, uint256 heldUsdc);
```

## Related

- [Deposits & withdrawals](https://docs.degenhive.ai/vaults/depositors.md) How fees apply during each daily roll.
- [Revenue](https://docs.degenhive.ai/revenue.md) Where the protocol's share goes.
- [Data](https://docs.degenhive.ai/data.md) How royalty feeds are priced.
- [Bonds and pay](https://docs.degenhive.ai/forecasters/bonds-and-pay.md) How forecasters are paid from the pot.
