> For the complete documentation index, see [llms.txt](https://docs.txflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.txflow.com/perp/liquidations.md).

# Liquidations

Liquidation is the automatic closure of your position when your account equity falls below the required Maintenance Margin. It protects both you and the platform from negative balances.

{% hint style="info" %}
Monitor your Margin Ratio actively. Once liquidation begins, you cannot add margin or cancel the process.
{% endhint %}

### Liquidation triggers

**Liquidation** is the automatic closure of your position when your account equity falls below the required **Maintenance Margin**. This protects both you and the platform from negative balances.

### Liquidation triggers

<table><thead><tr><th width="146.75">Margin modes</th><th width="385.88671875">Trigger</th><th width="383.49609375">Impact</th></tr></thead><tbody><tr><td>Cross margin</td><td>Account Equity &#x3C; Total Maintenance Margin</td><td>All cross positions may be liquidated together</td></tr><tr><td>Isolated margin</td><td>Position Margin &#x3C; Position Maintenance Margin</td><td>Only the specific isolated position is liquidated</td></tr></tbody></table>

#### Cross margin&#x20;

```
Account Equity < Total Maintenance
```

<table><thead><tr><th width="224.77734375">Component</th><th width="584.7578125">Formula</th></tr></thead><tbody><tr><td>Account Equity</td><td>Collateral + Unrealized PnL (all cross positions)</td></tr><tr><td>Total Maintenance Margin</td><td><code>Σ (Position Notional × MMR) for all cross positions</code></td></tr><tr><td>MMR</td><td>Maintenance Margin Rate — varies by tier (see <a href="/pages/RsrFttIKuKlVFyVqd25z">Margin Tiers</a>)</td></tr></tbody></table>

#### Isolated margin

```
Position Margin < Position Maintenance
```

<table><thead><tr><th width="248.921875">Component</th><th width="636.86328125">Formula</th></tr></thead><tbody><tr><td>Position Margin</td><td>Isolated Collateral + Unrealized PnL (this position only)</td></tr><tr><td>Position Maintenance Margin</td><td>Position Notional × MMR</td></tr></tbody></table>

### Liquidation Process

#### Step 1 — Trigger detection

The liquidation engine monitors all positions continuously. When equity falls below maintenance margin:

* The position is immediately marked for liquidation.
* No new orders can be placed on that position.
* Margin mode is locked — collateral cannot be transferred.

#### Step 2 — Cancel open orders

All open orders on the account are immediately cancelled.

#### Step 3 — Order submission

A single large IOC (Immediate-or-Cancel) order is submitted to reduce the position. The engine fills as much as possible and cancels the rest.

\
If the remaining margin is sufficient after this step (accounting for realized losses and liquidation fees), liquidation stops here.

#### Step 4 — Backstop liquidation

If margin is still insufficient after Step 3, the remaining position is closed at the **bankruptcy price** and transferred to the **Liquidator Vault**.

* **Cross position backstop:** The trader's cross positions and entire cross margin are transferred to the liquidator. If no isolated positions exist, the trader ends up with zero account equity.
* **Isolated position backstop:** Only that isolated position and its margin are transferred. Cross margin and other positions are untouched.

During backstop liquidation, the maintenance margin is not returned to the user — the Liquidator Vault requires this buffer to remain profitable on average.

{% hint style="info" %}
The **bankruptcy price** is the mark price at which the trader's total loss equals their deposited collateral (or initial margin). At this point, the margin balance reaches zero.
{% endhint %}

To avoid losing maintenance margin, place stop-loss orders or exit positions before the mark price reaches your liquidation price.

### Liquidator Vault

On most exchanges, backstop liquidation profits go to the exchange operator or privileged market makers. On TxFlow, all PnL from liquidations flows entirely to the community through the Protocol Vault.

### Related Pages

<table><thead><tr><th width="245.12109375">Pages</th><th width="520.9921875">Description</th></tr></thead><tbody><tr><td><a href="/pages/lWdZgI2P4YIODQ7uazsl">Mark Price and Oracle Price</a></td><td>Calculation of Mark Price and Oracle Price</td></tr><tr><td><a href="/pages/DtrP0qOYfmsqWIkA0BQ9">Vault</a></td><td>Protocol vault does market making and liquidations and receives a portion of trading fees.</td></tr></tbody></table>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.txflow.com/perp/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.
