> ## Documentation Index
> Fetch the complete documentation index at: https://pamm-api.exuratech.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Performance fees

> Configure Investor-level fees and reconcile credits to the Master's payment account.

Performance fees are configured per Investor and apply to eligible profit above the high-water mark (HWM). The fee debit comes from the Investor; the corresponding credit reaches the Master's payment account.

## Conceptual calculation

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
eligible_profit = max(accumulated_pnl - high_water_mark, 0)
performance_fee = eligible_profit × rate
```

* The HWM prevents the same profit from being charged twice.
* When no profit exists above the HWM, the fee is zero.
* The effective rate is stored per Investor. The Master's `default_perf_fee` is used when initializing that setting at assignment, not as a live override of all Investors.
* Amounts executed in MT5 follow the environment's monetary precision.

## Collection triggers

| Trigger | Timing | Behavior |
| - | - | - |
| Weekly run | Saturday at 00:00 UTC | Processes Investors with fees enabled. This is the only automatic period currently supported. |
| Withdrawal | Before `/investor/withdraw` | Crystallizes pending fees before calculating the effective withdrawal. |
| Unassignment | Before `/subscriptions/unassign` | Crystallizes and settles the fee before removing mirrored capital. |

## Configure one Investor

### Master default versus Investor rate

1. Send `default_perf_fee` when registering or creating the Master, for example `"0.30"`.
2. At assignment, a positive `perf_fee.rate` overrides that default; `perf_fee.enabled` then defaults to `true`.
3. Omitting `perf_fee`, sending null, or submitting a zero assignment rate inherits `default_perf_fee`. A positive inherited rate enables collection unless `enabled=false` was explicitly submitted. A zero inherited rate leaves collection disabled.
4. Read the persisted Investor setting after assignment. Changing the Master later does not change that setting.

> [!WARNING]
>
> A zero rate alone requests inheritance, not an opt-out. At assignment, send `perf_fee: {"rate": 0, "enabled": false}` to disable collection while retaining the inherited rate. To disable an existing Investor, use `/investor/perf-fee/update` with `enabled=false`. See [deployment compatibility](https://pamm-api.exuratech.com/reference/subscriptions.md#fee-initialization-rules) before using optional assignment settings.

Use `GET /api/v1/investor/{investor_login}/performance-fee` to read the current rate and `POST /api/v1/investor/perf-fee/update` to change future configuration.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "investor_login": "146600",
  "rate": 0.30,
  "enabled": true
}
```

Changing the rate does not replace the HWM or alter fees already executed. It can affect eligible accumulated profit that is still uncrystallized; it is not automatically limited to profit earned after the update. Record who authorized each change and when it became effective.

If `effective_since` is omitted, the current implementation writes the current operational time even for an existing configuration. To preserve the prior date, read it and send it explicitly. See [all update fields and defaults](https://pamm-api.exuratech.com/reference/performance-fees.md#update-investor-configuration).

## Reconcile both views

1. Use `/api/v1/perf-fee/transactions` for credits observed in the Master's payment account.
2. Use `/api/v1/perf-fee/master/{master_login}/investor-payments` for the Investor-level breakdown.
3. Deduplicate by stable identifiers such as `id`, `run_id`, `investor_mt5_login`, and `mt5_op_id`.
4. Use the Investor-level detail—not only an aggregate payment credit—when allocating commissions across sponsors or IBs.

> [card] [Previous: Subscriptions](https://pamm-api.exuratech.com/guides/subscriptions.md)
>
> Return to assignment and controlled exit.

> [card] [Next: Asynchronous operations](https://pamm-api.exuratech.com/reliability/async-operations.md)
>
> Handle delayed Master balance effects safely.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.