# Margin Modes

XYZ inherits its margining mechanisms from Hypercore.

#### Margin Mode

*Normal Isolated Margin:* allows an asset's collateral to be constrained to that asset. Liquidations in that asset do not affect other isolated positions or cross positions. Similarly, cross liquidations or other isolated liquidations do not affect the original isolated position. Currently, *Normal Isolated Margin* is enabled for XYZ100, Gold, and Silver.&#x20;

*Strict Isolated Margin*: functions the same as isolated margin, with the additional constraint that margin cannot be removed. Margin is proportionally removed as the position is closed. Currently, all markets outside of XYZ100, Gold, and Silver are set to *Strict Isolated Margin.*&#x20;

#### Initial Margin and Leverage <a href="#initial-margin-and-leverage" id="initial-margin-and-leverage"></a>

Leverage can be set by a user to any integer between 1 and the max leverage. Max leverage depends on the asset.

The margin required to open a position is `position_size * mark_price / leverage`. *Normal Isolated Margin* positions support adding and removing margin after opening the position. Isolated positions will apply unrealized pnl as additional margin for the open position. The leverage of an existing position can be increased without closing the position. Leverage is only checked upon opening a position. Afterwards, the user is responsible for monitoring the leverage usage to avoid liquidation. Possible actions to take on positions with negative unrealized pnl include partially or fully closing the position or adding margin (if isolated).&#x20;

**Maintenance Margin:** the minimum collateral you must keep to avoid liquidation. If your account equity (collateral + PnL) falls below the maintenance level, you'll be liquidated. The maintenance level is currently determined by multiplying the maintenance margin by the total open notional position. The maintenance margin is set to half of the initial margin at max leverage for that asset, which varies from 3-40x. In other words, the maintenance margin ranges from 1.25% (at 40x max leverage) to 16.7 (at 3x max leverage).


---

# 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.trade.xyz/risk-and-margining/margin-modes.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.
