# Liquidation Process

Astros utilizes **Mark Price** to minimize liquidation risks due to market manipulation or low liquidity. Liquidation occurs when the margin balance of a position reaches or falls below the **maintenance margin** threshold.

***

### Liquidation Price Calculations

The liquidation price is calculated differently based on the direction of the position:

#### For **Long Positions**:

$$
\text{Liquidation Price} = (\text{Average Entry Price}) \times (1 + \text{Maintenance Margin Fraction}) - \frac{\text{Position Margin Balance}}{\text{Contract Size}}
$$

#### For **Short Positions**:

$$
\text{Liquidation Price} = (\text{Average Entry Price}) \times (1 - \text{Maintenance Margin Fraction}) + \frac{\text{Position Margin Balance}}{\text{Contract Size}}
$$

***

### Perpetual Margin Level Calculation

To assess the current margin health of a perpetual contract position, Astros computes the margin level as follows:

$$
\text{Perpetual Margin Level (%)} = \frac{\text{Position Maintenance Margin}}{\text{Position Margin Balance}} \times 100%
$$

A margin level approaching or falling below 100% indicates an imminent liquidation risk.

Astros

### Margin Modes and Liquidation Impact

Astros provides two distinct margin modes, each with different liquidation implications:

#### **1. Isolated Margin Mode**

In isolated margin mode, liquidation risk and consequences are confined strictly to the margin and funding fees associated with the particular position being liquidated. Other positions and balances remain unaffected.

#### **2. Cross Margin Mode**

In cross margin mode, liquidation impacts are broader. When liquidation occurs, the trader risks losing:

* All collateral allocated.
* Accrued funding fees associated with open positions.
* Margins reserved for active orders (frozen margin).
* The entirety of the available account balance.

***

### Liquidation Outcomes at Bankruptcy Price

During liquidation at the **Bankruptcy Price**, two possible outcomes emerge:

* **Surplus Scenario**:\
  If liquidation occurs at a price more favorable than the bankruptcy price, excess collateral is automatically transferred into the **Insurance Fund**.
* **Deficit Scenario**:\
  If liquidation cannot be executed above the bankruptcy price, the resulting deficit is first covered by the **Insurance Fund**. However, if the Insurance Fund balance is insufficient to cover this deficit, the liquidation is further managed through the **Automatic Deleveraging (ADL)** mechanism, which systematically reduces other positions to restore financial stability.


---

# 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://naviprotocol.gitbook.io/astros/astros-perpetual/perpetual-trading/liquidation-process.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.
