# Fee Structure

Fees are fully on-chain and verifiable.

### Trading fee

Charged on each buy and sell.

```solidity
tradingFeeBps = 100; // 1%
```

* Deducted from USDC on `buy`.
* Stays in the vault. This increases NAV.

### Performance fee

Charged only when a user sells at a profit.

```solidity
feeBps = 0 ~ 3000; // max 30%
```

Calculation (conceptual):

```solidity
function _calculatePerformanceFee(
  address user,
  uint256 tokens,
  uint256 currentNav
) internal view returns (uint256 feeTokens) {
  EntryRecord storage record = entryRecords[user];
  if (currentNav <= record.weightedEntryNav) return 0;

  uint256 profitPerToken = currentNav - record.weightedEntryNav;
  uint256 totalProfit = (tokens * profitPerToken) / PRECISION;
  uint256 fee = (totalProfit * feeBps) / BPS;

  // paid as newly minted tokens to the leader
  feeTokens = (fee * PRECISION) / currentNav;
}
```

Notes:

* Fee is minted to the leader as vault tokens.
* Entry NAV uses weighted average.
* Entry NAV is inherited on transfers to reduce fee avoidance.

### Exit fee

Tiered by holding duration:

| Holding duration | Fee |
| ---------------- | --: |
| `< 7 days`       | 15% |
| `7–30 days`      |  8% |
| `30–90 days`     |  3% |
| `> 90 days`      |  0% |

```solidity
struct ExitFeeTier {
  uint256 daysHeld; // minimum days held
  uint256 feeBps;   // 100 = 1%
}
```

Destination:

* `exitFeeRecipient = address(0)`: stays in vault (increases NAV).
* Otherwise: sent to `exitFeeRecipient`.

### Protocol fee

Taken from trading fees and sent to protocol treasury.

```solidity
protocolFee = 100; // 1%
```


---

# 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://hyper-fun.gitbook.io/hypers.fun/tokenomics/fee-structure.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.
