# Isolated Margin

## What is Isolated Margin mode <a href="#what-is-margin" id="what-is-margin"></a>

In Isolated Margin approach margin is explicitly assigned to each position and is not shared across positions. However, cross-margin like functionalities can be achieved by enabling [auto margin top up](#auto-margin-top-up).

A position is specific to a particular contract. Thus, for each contract, two margin sub-accounts are maintained:

* **Position Margin:** Margin allocated to all existing (may include multiple long/ short positions) in given derivatives contract
* **Order Margin:** Margin allocated to all open orders in a given derivatives contract

It is worth noting that Unrealized PnL is not factored into Position Margin or Order Margin.

Position Margins and Order Margins are allocated from your Wallet Balance. Thus, at any time, the amount that remains unallocated is what is available for placing a new order. This is referred to as Available Balance.

$$
Available\ Balance = Wallet\ Balance - (Position\ Margin + Order\ Margin)
$$

Every time a new order is placed, the system does three things:

1. computes the Reservation margin for this new order,
2. checks whether $$Reservation \ Margin <= Available \ Balance$$, and
3. if 2 holds, then transfer Reservation Margin amount from Available Balance to the Order Margin of the contract.

## Risk Limits: Margin Requirement vs. Position Size <a href="#risk-limits-margin-requirement-vs-position-size" id="risk-limits-margin-requirement-vs-position-size"></a>

The Initial Margin and Maintenance margin requirements for any contract are increased as the position size increases. Increasing the margin requirement helps to ensure orderly liquidation of large positions and reduces the incidences of [auto-deleveraging](https://guides.delta.exchange/delta-exchange-user-guide/trading-guide/deleveraging).

Margin requirement remains flat till a certain position size (Position Threshold). Once position size crosses this threshold, margin requirement increases linearly with position size.

When **Position size is less than or equal to Position Threshold**:

$$Initial\ Margin% = Initial\ Margin%\_{MIN}$$&#x20;

$$Maintenance\ Margin% = Maintenance\ Margin%\_{MIN}$$&#x20;

and, when **Position size is greater than Position Threshold**:

$$Initial\ Margin% = Initial\ Margin%*{MIN} + Slope*{IM} \* (Position\ Size - Position\ Threshold )$$&#x20;

$$Maintenance\ Margin% = Maintenance\ Margin%*{MIN} + Slope*{MM} \* (Position\ Size - Position\ Threshold )$$&#x20;

The values of $$Initial\ Margin%*{MIN}$$,$$Maintenance\ Margin%*{MIN}$$, Position Threshold and Slope vary from contract to contract and are available in the [contract specifications.](https://global.delta.exchange/contracts)

## Reserved Margin Computation <a href="#reserved-margin-computation" id="reserved-margin-computation"></a>

Initial Margin (IM) requirements for a standalone order are as follows:

* Buy limit order

$$
IM = (Initial\ Margin% \* #Contracts \* Multiplier \* Limit\_Bid\_Price)
$$

* Buy market order

$$
IM = (InitialMargin% \* #Contracts \* Multiplier \* MarkPrice)
$$

* Sell limit order

$$IM = (InitialMargin% \* #Contracts \* Multiplier \* Max (Limit\ Offer\ Price, BestBid)$$&#x20;

* Sell market order

$$
IM = (InitialMargin% \* #Contracts \* Multiplier \* Max (MarkPrice, BestBid)
$$

Now, if there are existing positions/ open orders in the contract, then the Initial Margin requirement for the new combination of position and open orders is recomputed. For this computation, positions or orders on opposite side are netted in such a manner that for two offsetting orders, margin is reserved only once.

Reserved Margin is then the difference of the Initial Margin requirement for the combined position (existing + new order) and the Position Margin and Order Margin currently allocated to the derivative contract.

## Impact of order cancellations on margin <a href="#impact-of-order-cancellations-on-margin" id="impact-of-order-cancellations-on-margin"></a>

In a given contract, Order Margin account contains margin blocked for all the current open orders. If one or more of these open orders is cancelled, the Initial Margin requirement for the remaining open orders and existing orders is recomputed. The new Initial Margin requirement will either be same as earlier or lower. In the latter case, excess margin is released.

## Auto Margin Top-up

In Isolated Margin mode an open position has access to only the margin assigned to that position. Consequently, an open position may go into liquidation if the position margin erodes, even if there is sufficient balance available in a user’s account. This behaviour can be modified through the use of Auto Margin Top-up.

Auto Margin top-up is a feature that enables traders to automatically add margin to open positions in order to avoid liquidation. If Auto Margin Top-up is enabled for a position, whenever the position is about to go into liquidation Position Margin is replenished.

Recall that a position goes into [liquidation](https://guides.delta.exchange/delta-exchange-user-guide/trading-guide/margin-explainer/margin-explainer/liquidation) when the Remaining Position Margin (i.e. Initial Margin - Unrealised Losses) is equal to or lower than the Maintenance Margin. The quantum by which margin for a position is topped up each time is computed as follows:

* **For contracts where maximum leverage is 100x:** margin added to the position is equal to (minimum Initial Margin - Maintenance Margin), where minimum Initial Margin is the margin required to open the position at the highest allowed leverage.
* **For contracts where maximum leverage is <100x:** margin added to the position is equal to 0.5 times (minimum Initial Margin - Maintenance Margin), where minimum Initial Margin is the margin required to open the position at the highest allowed leverage.

If the Available Balance is less than the amount required for the top-up, then all of the Available Balance will be used to replenish the margin of the position. It is also important to note that Auto Margin Top-up cannot convert currency on its own and can draw margin only it is available in the settlement currency. For example, if the position that is about to go into liquidation required USDC margin and you only have BTC in your available balance, margin replenishment will fail.

### How to activate/ deactivate Auto Margin Top-up <a href="#how-to-activate-deactivate-auto-margin-top-up" id="how-to-activate-deactivate-auto-margin-top-up"></a>

Auto Margin Top-up can be enabled/ disabled by toggling a switch which is available with the entry of which open position. You also have the option to have Auto Margin Top-up activated by default for all positions you acquire. This can be enabled by checking Auto-margin Top-up option in the [preferences section.](https://global.delta.exchange/app/account/preferences)

### How is Auto Margin Top-up different from Cross Margin <a href="#how-is-auto-margin-top-up-different-from-cross-margin" id="how-is-auto-margin-top-up-different-from-cross-margin"></a>

In Cross Margin approach, margin is shared between open positions. At any time, the margin assigned to a position is equal to the minimum maintenance margin (i.e. position leverage is always the highest allowed). Whenever needed, a position draws more margin from the Available Balance to avoid liquidation.

Segregated Margin plus Auto Margin Top-up has similar properties as well but with two key differences:

* Unlike Cross Margin, you have the flexibility to open and maintain your position at a leverage of your choice
* In Cross Margin, margin drawn by a position to avoid liquidation will be released automatically if the position swings into profit. The same however will not happen automatically in the case of Segregated Margin plus Auto Margin Top-up. Once margin is added to a position, it can only be withdrawn manually.


---

# 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://guides.delta.exchange/delta-exchange-user-guide/trading-guide/margin-explainer/margin-explainer.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.
