# Liquidation Price

The liquidation price for a position is calculated based on the entry price and amount of collateral provided. The higher the leverage, the lower the collateral amount, therefore the higher the risk of liquidation.

{% hint style="warning" %}
To prevent your position from getting liquidated ALWAYS USE STOP LOSS orders.
{% endhint %}

Positions can only be liquidated using the Mark Price (the price from the price source).&#x20;

When a position is liquidated, the collateral for the position is not collected, only the taker fee.

### Liquidation Price Formula

$$
LP = NLP ± P \* C
$$

#### Definitions

| LP  | Liquidation Price                                                |
| --- | ---------------------------------------------------------------- |
| NLP | Net Liquidation Price                                            |
| P   | Entry Price                                                      |
| C   | Margin Call Coefficient                                          |
| M   | Margin (Collateral)                                              |
| MOV | Allowed price movement before margin call                        |
| FC  | Funding Cost                                                     |
| S   | Position Size                                                    |
| FB  | Funding Blocks (the number of blocks the position is opened for) |
| FR  | Funding Rate (rate per block)                                    |
| L   | Leverage                                                         |
| MM  | Maintenance Margin                                               |

#### Formulas

| Parameter | Formula            |
| --------- | ------------------ |
| NL        | P ± MOV            |
| MOV       | (M - FC) / S       |
| FC        | S \* P \* FB \* FR |
| C         | MM / L             |
| L         | P \* S / M         |

{% hint style="success" %}
Use Stop-Limit (Stop-Loss) orders to prevent the position from getting liquidated!
{% endhint %}


---

# 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.dmex.app/formulas/untitled.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.
