# Reallocation on deposit and withdrawal

On each deposit and withdrawal operation, open positions on a PAMM master account are reallocated to PAMM investment accounts subscribed to it, in proportion to equities.

## **Example**

Consider PAMM investment accounts #1 and #2 that are subscribed to a PAMM master account:

`Balance on PAMM master account = 0`

`Balance on PAMM investment account #1 = 0`

`Balance on PAMM investment account #2 = 0`

### **Step 1: Investor #1 transfers 1,000 USD to the PAMM investment account #1.**

During rollover, a transfer is made.

‍**Result:** The balances on both the PAMM investment account #1 and PAMM master account have increased by 1,000 USD.

<figure><img src="/files/WYKPYA8uWiF9N29D8vBF" alt=""><figcaption></figcaption></figure>

### **Step 2: The PAMM trader opens a EUR/USD position for buying 1 lot at the price of 1.1555.**

‍**Result:** This position has been reallocated only to the PAMM investment account #1 (because this account has a positive balance) in the following volume:

`Position volume for Investor #1 = 1 lot * 1,000/1,000 = 1 lot`

<figure><img src="/files/JmFcy6Rx4JQY5xB7s2V0" alt=""><figcaption></figcaption></figure>

### **Step 3: EUR/USD is now traded at the price of 1.1600.**

‍**Result:** The account equities have changed as follows:

`Equity of PAMM master account = Equity of PAMM investment account #1 = 1,000 + 1 lot * (1.1600 - 1.1555) * 100,000 = 1,450`

<figure><img src="/files/ub7v2bmTFG3tLhlpgNqE" alt=""><figcaption></figcaption></figure>

### **Step 4: Investor #2 transfers 550 USD to the PAMM investment account #2.**

During rollover, a transfer is made.

‍**Result:** The balances on both the PAMM investment account #2 and PAMM master account have increased by 550 USD.

**Balance of PAMM master account = 1,000 + 550 = 1,550**

**Balance of PAMM investment account #2 = 0 + 550 = 550**

The open position on the PAMM master account is reallocated to both the PAMM investment accounts #1 and #2 in proportion to equities.

For this purpose, the open EUR/USD position for 1 lot on the PAMM investment account #1 has been closed at the current market price (1.1600).

`Profit from 1 lot closed (for PAMM investment account #1) =`\
`= 1 lot * (1.1600 - 1.1555) * 100,000 = 450`

`Balance on PAMM investment account #1 = 1,000 + 450 = 1,450`

The following volumes are reallocated from the PAMM master account to the PAMM investment accounts #1 and #2:

`Position volume for Investor #1 = 1 lot * 1,450/2,000 = 0.73 lots`

**‍**`Position volume for Investor #2 = 1 lot * 550/2,000 = 0.27 lots`

<figure><img src="/files/YucOXOyWj73YfvvRMqzQ" alt=""><figcaption></figcaption></figure>

### **Step 5: EUR/USD is now traded at the price of 1.1700.**

‍**Result:** The account equities have changed as follows:

`Equity of PAMM master account =`\
`= 1,550 + 1 lot * (1.1700 - 1.1555) * 100,000 = 3,000`

`Equity of PAMM investment account #1 =`\
`= 1,450 + 0.73 lots * (1.1700 - 1.1600) * 100,000 = 2,180`

`Equity of PAMM investment account #2 =`\
`= 550 + 0.27 lots * (1.1700 - 1.1600) * 100,000 = 820`

<figure><img src="/files/FbZQiOZ8TVYVUpsIlXdn" alt=""><figcaption></figcaption></figure>

### **Step 6: Investor 2 requests to close the PAMM investment account #2 and transfer all funds from this account to the wallet.**

During rollover, the request to close the account is executed and a transfer is made.

‍**Result:** The open position on the PAMM investment account #2 has been closed at the current market price (1.1700).

`Profit from 0.27 lots closed (for PAMM investment account #2) =`\
`= 0.27 lots * (1.1700 - 1.1600) * 100,000 = 270‍`

`Balance on PAMM investment account #2 = 550 + 270 = 820`

The available amount of 820 USD has been withdrawn from the PAMM investment account #2 to the investor’s wallet. The balance on the PAMM master account has reduced by the amount withdrawn from the PAMM investment account #2.

`Balance on PAMM master account = 1,550 - 820 = 730`

`Balance on PAMM investment account #2 = 820 - 820 =`\
`0‍`

The open position on the PAMM master account is reallocated to the PAMM investment account #1 in proportion to equities.

For this purpose, the open EUR/USD position for 0.73 lots on the PAMM investment account #1 has been closed at the current market price (1.1700).\
\
`Profit from 0.73 lots closed (for PAMM investment account #1)= 0.73 lots * (1.1700 - 1.1600) * 100,000 = 730`

`Balance on PAMM investment account #1 = 1,450 + 730 = 2,180`

The following volume is reallocated from the PAMM master account to the PAMM investment account #1:

`Position volume for Investor #1 = 1 lot * 2,180/2,180 = 1 lot`

<figure><img src="/files/Xy1ULJ8Kr3zHYPSQuPCS" alt=""><figcaption></figcaption></figure>

### **Step 7: EUR/USD is now traded at the price of 1.1650.**

**Result:** The account equities have changed as follows:

`Equity of PAMM master account =`\
`= 730 + 1 lot * (1.1650 - 1.1555) * 100,000 = 1,680`

`Equity of PAMM investment account #1 =`\
`= 2,180 + 1 lot * (1.1650 - 1.1700) * 100,000 = 1,680`

<figure><img src="/files/iUTJ73hEZErE1mhyVY6C" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/raOLZXY43f3WUcHHHf4W" alt=""><figcaption></figcaption></figure>

## Handling insufficient free margin during withdrawal

In the examples above, the PAMM master account had enough free margin to process the withdrawal as a balance operation without affecting open positions. However, in practice, the master trader may have most or all of the capital allocated to open positions.

If the free margin on the PAMM master account is not sufficient to process a pending withdrawal during rollover, the system automatically partially closes open positions on the master account to release the required funds.

The process works as follows:

1. The system calculates the total amount needed for all pending withdrawals.
2. If the available free margin is sufficient, positions are not affected.
3. If the available free margin is insufficient, the system calculates how much margin needs to be released and partially closes open positions proportionally to free up the required amount.
4. This process runs iteratively until enough margin is available to process all pending withdrawals.

{% hint style="info" %}
Position closures are handled entirely by the system during the rollover process. Neither the master trader nor the investor needs to take any action. The system determines which volumes to close from each position automatically, based on the margin required.
{% endhint %}

This mechanism applies to all types of withdrawals processed during rollover, including regular investor withdrawals and withdrawals triggered by subscription termination (for example, when a [risk limit](/copy-trading-pamm-and-mam-concepts/risk-limits-for-investors.md) is exceeded).


---

# 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://docs.b2copy.b2broker.com/copy-trading-pamm-and-mam-concepts/allocation-methods-for-pamm/reallocation-on-deposit-and-withdrawal.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.
