> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.paradex.trade/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paradex.trade/_mcp/server.

# Deleveraging

## Mechanism

The deleveraging process is a periodic check for accounts with open orders to determine if the account has sufficient value to maintain those orders.

If the account does not meet the initial margin requirement, the exchange cancels open orders that increase the account's risk.

This prevents those orders from being matched resulting in a fill that is likely to be rejected on-chain since the order violates [Order Risk Check](paradex-risk-checks/).

The main objective of deleveraging is to prevent orders from resulting in invalid fills

This check compares the [Account Value](margin-term-reference#account-value-usd) to the [Initial Margin Requirement](margin-term-reference#margin-requirement) (see how IMR is calculated in [Cross Margin](cross-margin-requirement#initial-margin-requirement-imr) or [Portfolio Margin](portfolio-margin) mode).

* If $\text{Account Value} < \text{Account IMR}$, **Account Deleveraging** kicks in :
  * All orders that do not offset an open position on the same instrument (i.e. the account does not have an open position in this instrument **or** has an open position on the same side as the open order) are canceled since these non-offsetting
  * Order offsetting an open position (opposite side) are not canceled unless the cumulative size of those orders exceeds the position size, in which case the most passive orders are canceled until the remaining cumulative size of offsetting orders is equal or lower than the position size

## Example

Alice account has :

* A **long** ETH-USD-PERP position of size **10**
* A **buy** ETH-USD-PERP order of size **2** with a limit price of **1'900**
* A **sell** ETH-USD-PERP order of size **5** with a limit price of **2'150**
* A **sell** ETH-USD-PERP order of size **3** with a limit price of **2'100**
* A **sell** ETH-USD-PERP order of size **3** with a limit price of **2'200**

Due to ETH-USD-PERP price decrease, Alice account value drops below the account IMR and the exchange puts the account in **Deleveraging Mode** :

* First, the buy order is canceled since it is on the same side as the position
* The total size of sell orders is **11** which is higher than the position size (10) :
  * The exchange starts by canceling the most passive order (sell order of size 3 at price 2'200)
  * The total remaining sell order is **8** which is less than the position size. Therefore, no more order cancellation is made

After deleveraging, Alice end up with :

* A **long** ETH-USD-PERP position of size **10**
* A **sell** ETH-USD-PERP order of size **5** with a limit price of **2'150**
* A **sell** ETH-USD-PERP order of size **3** with a limit price of **2'100**