# Deleverage Queue

Counterparty liquidation, also referred to as auto-deleveraging, is a last resort measure in the Pascal Protocol, enacted only when the Default Fund cannot cover a bankrupt trader’s positions. The protocol strives to minimise the necessity and impact of such events. However, given the inherent volatility in crypto markets and the decentralised structure of Pascal Protocol, counterparty liquidation remains a mandatory mechanism to enforce market integrity under all circumstances.

To facilitate counterparty liquidations, the Pascal Protocol maintains an auto-deleverage queue, ranking all open positions for each contract by their profitability or entry price. In the event of counterparty liquidation, the protocol selects equivalent positions from this queue and closes them at the current mark price, thus preserving the market's long and short balance.

### **ADL Queue and Trader Positions**

Traders who are deleveraged aren’t penalised in any way and are free to immediately re-enter the market. To enhance transparency, the protocol calculates and provides a deleverage rank for each open position, indicating its relative place in the ADL queue. This rank can be displayed by Jetstream Frontends, allowing traders to gauge their risk of being deleveraged.

The ADL queue organises traders' positions based on their weighted average entry price. A trader can alter their place in the queue by re-entering the market at the current price, pushing their position to the end of the queue. Partially closing position affects only the size subject to deleveraging, without altering the queue placement.

### **Preserving Market Equilibrium**

Counterparty liquidation is a critical tool to preserve long-short equilibrium in any possible scenario, employed only when other measures are insufficient. The protocol uses ADL judiciously, ensuring it acts as a last resort to uphold the integrity and balance of the trading environment.


---

# 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.pascalprotocol.com/deleverage-queue.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.
