# Liquidation

A liquidation occurs when a trader’s position moves against them enough that their account equity falls below the maintenance margin (maintenance margin is set to half of the initial margin at max leverage, ranging from \~1.25% at 40x to \~16.7% at 3x depending on the asset).

When this threshold is breached, the liquidation engine attempts to close the position(s) via market orders sent to the order book. These orders are for the full position size and may be fully or partially filled. If liquidation succeeds (fully or partially) such that maintenance margin requirements are met again, any remaining collateral stays with the trader.

Liquidations are based on the mark price, a blend of CEX spot prices and HyENA's internal book data, which offers a fairer, more stable reference during volatility.

As HyENA is a HIP-3 DEX, there is currently no backstop liquidation. Liquidations go directly to the order book, allowing open participation, avoiding clearance fees, and letting traders retain remaining margin. Large positions are partially liquidated (20%) first, with a 30-second cooldown before full liquidation attempts. HyENA's liquidity vault, [HLPe](https://docs.hyena.trade/hlpe), will endeavor to facilitate liquidations through the orderbook and distribute the PnL to HLPe depositors.

Hyperliquid’s UI may label certain events as “backstop liquidations.” However, these are in fact Auto-Deleveraging (ADL) events. As noted above, Hyperliquid does not currently implement a backstop liquidation mechanism for HIP-3 DEXs.

If the order book cannot absorb liquidation and losses push an isolated position value negative, Hyperliquid’s Auto-Deleveraging (ADL) is the final solvency safeguard. Users on the opposite side are ranked by unrealized PnL and leverage used - with a specific sorting index defined by Hyperliquid - and those traders’ positions are closed at the previous mark price against the underwater position.

Liquidation prices are shown when a position is opened, though they may vary slightly with funding changes or PnL fluctuations.

The formula for calculating the liquidation price is:

> liq\_price = price − side × margin\_available / position\_size / (1 − l × side)

where

* l = 1 / maintenance leverage
* side = 1 for long, −1 for short
* margin\_available depends on whether the position is cross or isolated.


---

# 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.hyena.trade/trading/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.
