# Liquidations

If traders have any open orders, they will be canceled first. This ensures that any margin taken up by these sets of orders is freed up and re-used for the liquidateable positions, thus potentially preventing them from getting liquidated. Users will not be able to send any more orders during this process, which may take up more margin, thus increasing the risk of liquidation even further. Users can send new orders again once open orders have been canceled and the available margin has been added to liquidateable positions.

However, if the margin is still below the maintenance margin requirements of the user's positions, liquidators can liquidate positions by sending a liquidation instruction. Learn more on how liquidators function [here](liquidators). Liquidators specify the TRG to liquidate, the market, and the size to be liquidated. Upon successful execution of the liquidate instruction, the liquidator will trade with the liquidatee the positions to liquidate. For liquidating, the liquidator receives the liquidatee's collateral put up for maintenance margin as a reward.

The price at which the liquidator trades with the liquidatee is fixed at `1 * 1d_standard_deviation * order_size`

### How do Liquidations work on PepperDEX?

Liquidations on Hxro Network / PepperDEX work similarly to other exchanges and are tied to margin. Hxro Network determines the health of an account using the following three ways:

* If the margin required for the position is above the threshold of 3 \* 1d\_standard\_deviation \* order\_size, the account is considered to be extremely healthy.
* If the margin required for the position is exactly at the of 3 \* 1d\_standard\_deviation \* order\_size, the account is considered to be healthy.
* If the margin required for the position is below the threshold of 3 \* 1d\_standard\_deviation \* order\_size, but above the threshold of 3/2 \* 1d\_standard\_deviation \* order\_size, the account is considered to be unhealthy.
* If the margin required for the position is below the threshold of 3/2 \* 1d\_standard\_deviation \* order\_size, the account is considered to be liquidateable.

When the margin levels of an account dips below the 3/2 \* 1d\_standard\_deviation \* order\_size, the account is open for liquidation by liquidators. Here is what may happen to your account once it is open for liquidation.

* If a trader has any open orders, they will be canceled first. This ensures that any margin taken up by these orders is freed up and re-used for the liquidateable positions, thus potentially preventing them from getting liquidated. Please note that users will not be able to make any more orders during this process, which may take up more margin, thus increasing the risk of liquidation even further. Users can send new orders again once open orders have been canceled and the up margin has been added to liquidateable positions.
* However, if the margin is still below the maintenance margin requirements of the user's positions, liquidators can liquidate positions by sending a liquidation instruction. Learn more on how Liquidators function here. Liquidators specify a specific TRG to liquidate, the market, and the size to be liquidated. Upon successful execution of the liquidate instruction, the liquidator will trade with the liquidatee the positions to liquidate at the _Index Price_ of the market at the time. For liquidating, the liquidator receives a fixed % of the liquidatee's collateral put up for maintenance margin as a reward.

### How to Protect Yourself from Liquidations?

Liquidations are a feature of sharp market movements and volatility. Although Hxro Network and PepperDEX try to mitigate risks of market manipulation and sudden wicks within the protocol causing unfair liquidations by using the Index Price to dictate liquidations and not the Mark Price, there is always a chance of underlying market volatility, especially in long-tail markets. Thus, always be vigilant while trading leveraged products such as Perpetuals and ZDFs! Always manage your risks using stop-loss orders, ensure enough margin is available, and positions are not overleveraged beyond an appropriate appetite.
