# Liquidation

The maintenance margin is the minimum margin required to keep the position open and not liquidated. The position will be liquidated if its margin falls below the maintenance margin.

Maintenance leverage is the maximum effective leverage that the position leverage can reach. The position will be liquidated if its leverage exceeds the maintenance leverage.

Maintenance Margin (MM) = IndexPrice \* Position Value \* MMR%

| Pool type       | Lever   | MMR%    |
| --------------- | ------- | ------- |
| Aggregated Pool | 2-21x   | 20%     |
| <p><br></p>     | 22x-30x | 21%-29% |
| <p><br></p>     | 31x-43x | 30%-39% |
| <p><br></p>     | 44x-50x | 40%-45% |
| Isolated Pools  | 2-100x  | 30%     |

MMR% is system parameters, which will be changed later through governance.

### Liquidation Fee Sequence

The sequence of fees deducted during liquidation varies between the aggregate pool and the isolated pool, designed for risk control and to reduce the cost for users to open positions.

**Aggregate Pool Liquidation Fee Sequence:**

Trading Fee → Executor Fee → LP Earnings

* The trading fee is the base of protocol income and is prioritized for collection. See details on [protocol revenue](/protocol-revenue.md).
* Executor fees are paid to the main chain for gas, which are unavoidable. See details on [executor](/products/executor.md).
* LP earnings include funding fees and losses from user positions. See details on [funding rate](/products/funding-rate.md).

It's important to note that in extreme market conditions leading to a situation where losses exceed the margin (liquidation), priority is given to the collection of trading fees and executor fees, and it cannot be guaranteed that LPs will receive full earnings.

**Isolated Pool Liquidation Fee Sequence:**

Trading Fee → LP Earnings → Executor Fee

* The trading fee is the foundation of protocol income, prioritized for collection. See details on [protocol revenue](/protocol-revenue.md).
* LP earnings include funding fees and losses from user positions. See details on [funding rate](/products/funding-rate.md).
* Executor fees are paid to the main chain for gas, which are unavoidable. See details on [executor](/products/executor.md).

In the event of a liquidation caused by extreme market conditions in the isolated pool, it's also not guaranteed that LPs will receive full earnings. However, all remaining assets after trading fees are deducted will be allocated to LPs, with the protocol bearing the cost of the executor.


---

# 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.borabora.ooo/products/liquidation.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.
