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

# Integration model

> Define system ownership and the mandatory separation of PAMM accounts.

## Responsibility boundaries

| Component    | Customer-facing responsibility                                                                                                                       |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| External CRM | Users, KYC, internal wallets, products, sponsors or IBs, interface, approvals, and its own reconciliation.                                           |
| PAMM API     | MT5 account provisioning or registration, subscriptions, capital synchronization, withdrawals, controlled unassignment, and performance fee records. |
| MT5          | Final source for accounts, balances, executed money movements, and trading operations.                                                               |

The PAMM API accepts integration commands and exposes their resulting state. It does not replace the CRM's customer ledger or authorization process.

## How capital moves

```text theme={null}
CRM-authorized funds
        │
        ▼
Investor MT5 account ── mirrored operating movement ──► Master MT5 account
        │                                                   │
        └── fee debit ──► Master payment account ◄──────────┘
```

1. External capital is credited only to the Investor account.
2. On assignment, the engine queues the Investor's current balance for reflection in the Master.
3. Later Investor deposits and withdrawals produce corresponding operating adjustments.
4. Eligible gains contribute to the Investor's performance fee calculation.
5. The fee is debited from the Investor and credited to the Master's payment account.

<Warning>
  Never deposit directly into a Master account. Its balance must be the consequence of Investor capital and PAMM movements. An external Master deposit breaks pool reconciliation.
</Warning>

## Existing MT5 accounts

`/master/add` and `/investor/add` register accounts that already exist in MT5. This path is intended for coordinated migrations. For new integrations, prefer `/master/create` and `/investor/create` so the account roles are provisioned consistently.

<CardGroup cols={2}>
  <Card title="Previous: Overview" icon="arrow-left" href="/getting-started/overview">
    Review the account model and sequence.
  </Card>

  <Card title="Next: Authentication" icon="arrow-right" href="/getting-started/authentication">
    Configure secure server-to-server access.
  </Card>
</CardGroup>
