> ## Documentation Index
> Fetch the complete documentation index at: https://pamm-api.codench.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={null}
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 rate belongs to the Investor relationship, not to the Master globally.
* 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

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={null}
{
  "investor_login": "146600",
  "rate": 0.30,
  "enabled": true
}
```

Changing the rate does not replace the HWM or alter fees already executed. Record who authorized each change and when it became effective.

## 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.

<CardGroup cols={2}>
  <Card title="Previous: Subscriptions" icon="arrow-left" href="/guides/subscriptions">
    Return to assignment and controlled exit.
  </Card>

  <Card title="Next: Asynchronous operations" icon="arrow-right" href="/reliability/async-operations">
    Handle delayed Master balance effects safely.
  </Card>
</CardGroup>
