# Margining

Ethereal uses cross-margining as the default for all positions. While the platform's subaccount system is designed to support both cross and isolated margin modes, isolated margin functionality is not yet available in the current app version. Refer to the [Market Specifications](/trading/perpetual-futures/market-specifications.md) for current configurations.

**Initial Margin Requirements**

When opening a position, you must meet the initial margin requirement based on the market's maximum leverage, which is set at the market level and can be checked in the market details page. The initial margin calculation follows the formula:

$$
\text{initial\_margin} = \frac{\text{position\_size} \times \text{mark\_price}}{\text{leverage}}
$$

For example, with 3x leverage on a 1 ETH position at $3,000 mark price, the initial margin required would be `1 * 3000 / 3 = 1000`.

**Maintenance Margin**

Maintenance margin represents the minimum equity threshold that must be maintained to avoid liquidation. Each market has its own maintenance margin fraction, calculated as:

$$
\text{maintenance\_margin} = \frac{1}{\text{max\_leverage} \times 2}
$$

For the BTC-USD market with 50x max leverage, this results in a 1% maintenance margin fraction, meaning you must maintain equity of at least 1% of your total open notional position.

**Available Margin in Mainnet Alpha**

During alpha phase out of an abundance of caution for the security of the protocol, the margin configuration is set such that:

* Unrealized gains are excluded from margin calculations to limit systemic risks
* Unrealized losses directly affect available margin by reducing the amount of balance available for margin

This only effects available margin to open new trades and withdrawable margin. Positions can be closed to increase available margin.

**Liquidation Process**

Positions are liquidated when the mark price from Pyth Lazer oracle causes equity to fall below maintenance margin. The insurance fund and liquidator subaccount handle liquidations to prevent socialized losses, while a "first bankruptcy price" cap prevents accounts from being pushed into negative equity by extreme price movements. Refer to the [liquidations section](/trading/perpetual-futures/liquidations.md) to learn more.


---

# 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.ethereal.trade/trading/perpetual-futures/margining.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.
