> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qfex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Margin and Liquidations

> A Detailed Description of the Liquidation Cascade

QFEX is disrupting the traditional way that futures are cleared to bring capital efficiency and leverage never seen before to traditional markets.
Traditional, intermediated markets hide the risk of leverage amongst their brokers, and try to regulate away tail cases with high capital requirements, leading to poor UX.
We have created innovative, fair and transparent **multi-stage de-risking procedure** that prioritizes the safety of a user's wallet balance in the event of a margin call.

Users can also set their leverage level to be lower than the maximum to improve their safety.

All QFEX products are **cross-margined**.

## Margin Call and Close-Out Procedure

Margin is monitored continuously:

* All users are evaluated simultaneously and on equal terms.
* An account that restores sufficient equity is not liquidated.

### Initial Steps

**Condition:** `Account Equity < Maintenance Margin`

#### Order margin release and soft liquidation

When the account enters the liquidation procedure, QFEX can convert its resting orders to reduce-only to release order margin. This happens automatically, without an order modification request from you. In the most severe cases, resting orders are cancelled outright before the netting and off-orderbook steps below.

For the reduce-only conversion, the flow is:

1. Each affected resting order is modified in place. Its order ID, price, remaining quantity and price/time priority are preserved; it now may only reduce an existing position.
2. QFEX sends an order modification update for each newly converted order. Orders already marked reduce-only do not receive another conversion update.
3. Order margin is released. If this restores sufficient margin, no further liquidation action is needed; otherwise, the liquidation procedure continues below.
4. At execution, the order can fill only against the position still available to reduce. It cannot increase a position or reverse it. If there is no position to reduce, or the order is on the wrong side, it can be cancelled when it would otherwise match. If only part can reduce the position, that part can fill and the remaining quantity is cancelled.

Restoring sufficient margin does not automatically switch converted orders back to ordinary orders. Check their current reduce-only setting before relying on them to open or increase a position.

For example, you are long 5 units and have a resting sell order for 8 units. After conversion, the order can sell at most the 5 units still available to close; the remaining 3 are cancelled. If another trade or liquidation closes the position first, the sell order can be cancelled without a fill even when the market reaches its price. A resting buy order would also be unable to fill while you are long, because it would increase the position.

##### What website users see

* In the trading terminal's Open Orders table, the affected order remains open and its Reduce Only column changes to Yes.
* Subject to your trading notification preferences, the conversion produces an “Order modified” notification. This notification can appear even though you did not edit the order; it does not specifically say “soft liquidation”.
* If the order later cannot reduce your position, it leaves Open Orders when cancelled. Trading notifications may show “Order cancelled” or “Order partially filled and cancelled”, depending on whether any quantity filled. Check Order History and your current position to understand the outcome.

A price touching your order is therefore not enough to guarantee a fill: the order must still be able to reduce your position at execution time.

##### What programmatic users receive

Subscribe to the authenticated WebSocket `order_responses` channel. Each conversion is pushed as an `order_response` with `status: "MODIFIED"`, `reduce_only: true`, and `order_origin: "SET_REDUCE_ONLY_ALL"`, using the existing `order_id` and `client_order_id`. Process this unsolicited update even if you have no pending modify request. A later cancellation is a separate `CANCELLED` update; the conversion itself is not a cancellation or a fill.

See [Order responses — automatic reduce-only conversion](https://docs.qfex.com/websocket/channels/trade/order.md#automatic-reduce-only-conversion) for a message example, client handling and reconnect guidance.

#### Netting of Liquidated Positions

* Opposite liquidated positions are **netted internally** between accounts.
* Trades are booked at current Mark Price.

**Example:**

> Account 1: Long 100 units of Symbol Y\
> Account 2: Short 100 units of Symbol Y\
> → Positions netted, no order book impact.

### Next Steps

##### Orderbook Liquidations

**Condition:** `Maintenance Margin / 2 < Account Equity < Maintenance Margin`

* Compute notional amount to liquidate.
* Cap notional amount to ensure that the overall amount of liquidation quantity submitted to the orderbook does not cause the 60-second EMA of this quantity to exceed the Orderbook Liquidation Limits.
* Enter limit IOC orders at `Mark Price ± Liquidation Spread`.

##### Off-Orderbook Liquidation

**Condition:** `Account Equity ≤ Maintenance Margin / 2`

* Positive Account Equity drained into the **Reserve Fund**.
* Negative equity covered from the Reserve Fund (if sufficient).
* Positions transferred to Designated Liquidity Provider (DLP) participant at Mark Price, up to the maximum quantity such that the DLP Fee can be covered by the Reserve Fund.
* Reserve Fund covers DLP Fees (which are 0 if the trade was risk-decreasing for the Designated Liquidity Provider).

##### Auto-Deleveraging

**Condition:** `Account Equity ≤ Maintenance Margin /2` and Off-Orderbook Liquidation incomplete.

Procedure:

* Rank accounts with the opposite-side position on the required symbol by `(Account Equity / Position Maintenance Margin)`.
* Net off positions against the opposite side accounts, in rank order, ensuring that the liquidated account is flattened with 0 Account Equity.

## Margin Call Notifications

Clients receive alerts (email + browser) when margin falls below:

* **75%** of Initial Margin (warning)
* **66.6%** of Initial Margin (close out notification)

## Designated Liquidity Provider (DLP) Program

An opt-in program for qualified market makers to absorb liquidated positions efficiently when the orderbook cannot.

Allocation is **pro-rata** to Designated Liquidity Providers by available margin capacity.

* Provider positions must remain within position limits.
* Providers receive a **DLP Fee** for each liquidation absorbed.
* Pesignated Liquidity Provider operations follow strict risk control and monitoring standards.

## Orderbook Liquidation Limits

Orderbook liquidation limits vary by symbol and market condition. They are enforced against a 60-second exponential moving average of liquidation notional.

## Reserve Fund and Stress Testing

Regular stress testing of the Liquidation Protocol ensures that the system can handle extreme market conditions while maintaining adequate Reserve Fund levels. The exchange monitors liquidation frequency and effectiveness to optimize protocol parameters and ensure continued system resilience.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.