> For the complete documentation index, see [llms.txt](https://learn.trovemarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.trovemarkets.com/risk/margin-calculations.md).

# Margin calculations

IM, MM and liquidation formula

#### Margin definitions <a href="#margin-definitions" id="margin-definitions"></a>

* **Initial Margin (IM):** collateral required to open a position.
* **Maintenance Margin (MM):** minimum collateral to keep a position open; falling below triggers liquidation.

<figure><img src="https://1260844251-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsYicgdprPMCcN2najEb5%2Fuploads%2FvVmyjQd6H6BKQd5TQ9AF%2FScreenshot%202025-11-08%20at%204.21.57%E2%80%AFPM.png?alt=media&amp;token=f7d6496b-0c4d-45df-b5eb-2a110bd1f622" alt="" width="318"><figcaption></figcaption></figure>

Let **IMR = 1 / MaxLeverage** and **MMR** be the maintenance margin ratio (displayed in the UI; subject to change per market).

***

### Approximate liquidation prices (isolated-formula intuition) <a href="#approximate-liquidation-prices-isolated-formula-intuition" id="approximate-liquidation-prices-isolated-formula-intuition"></a>

Ignoring fees/funding for intuition, for a position opened at price P*e*:

**Long liquidation (approx.):**

$$
P\_{\text{liq,long}} \approx \frac{P\_e - \frac{M}{q}}{1 - m}
$$

**Short liquidation (approx.):**

$$
P\_{\text{liq,short}} \approx \frac{P\_e + \frac{M}{q}}{1 + m}
$$

Where 𝑞 > 0 is quantity, 𝑀 is isolated margin, and m = 10% is the maintenance ratio

{% hint style="info" %}
These are simplified for intuition. Actual liquidation considers live mark, fees, funding accrual, and execution slippage.
{% endhint %}


---

# 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, and the optional `goal` query parameter:

```
GET https://learn.trovemarkets.com/risk/margin-calculations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
