> For the complete documentation index, see [llms.txt](https://docs.txflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.txflow.com/perp/auto-deleveraging-adl.md).

# Auto-Deleveraging(ADL)

ADL is TxFlow's final safeguard for platform solvency. It only activates when a user's account value (or isolated position value) becomes negative — meaning the Liquidator Vault cannot cover the shortfall.

When ADL is triggered, traders on the opposite side of the underwater position are ranked and closed against it at the previous mark price. This prevents bad debt from accumulating on the platform.

**A strict invariant is maintained:** users with no open positions will never bear any platform losses under any circumstances.

### ADL priority queue

Traders are ranked by:

1. **Highest PnL %** — most profitable positions are deleveraged first
2. **Highest effective leverage** — riskier positions are deleveraged first within the same PnL tier

Backstop liquidated positions receive no special treatment in the ADL queue.

{% hint style="info" %}
ADL is rare. It only occurs during extreme market events such as flash crashes where the insurance fund is fully exhausted.
{% 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:

```
GET https://docs.txflow.com/perp/auto-deleveraging-adl.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.
