# Liquidations

Liquidations will protect the Nexus Exchange from insolvency by ensuring that traders maintain sufficient margin to support their leveraged positions.&#x20;

When a trader’s account equity falls below the required maintenance margin, NexusCore’s liquidation engine will automatically intervene and close the position at the current mark price, preventing negative balances and preserving system-wide solvency.

#### How Liquidation Works

**Mark Price & Equity**

Nexus will use a mark price derived from the oracle. A trader’s equity will be computed from:

$$
equity = collateral + unrealized\_-pnl(mark\_-price)
$$

**Margin Requirements**

* Initial Margin

$$
initial\_-margin = (position\_-size × entry\_-price) / leverage
$$

* Maintenance Margin

$$
maintenance\_-margin = 1 / (max\_-leverage × 2)
$$

**Liquidation Trigger**

A position will be liquidated when equity falls below maintenance margin.

**Liquidation Process**

1. Trigger: Equity falls below maintenance margin.
2. Execution: A dedicated on-chain liquidator sub-account closes the position at or near mark price.
3. Bankruptcy Protection: A price cap prevents negative balances.
4. Insurance Fund: Covers any remaining shortfall if the position cannot be closed in time.


---

# 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.nexus.xyz/trading/perpetuals/liquidations.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.
