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

# Auto-Deleveraging (ADL)

### **What is Auto-Deleveraging?**

**Auto-Deleveraging (ADL)** is a last-resort risk management mechanism used by the platform to maintain market stability. It is triggered in **extreme market conditions** when:

* A counterparty’s losses exceed the coverage of the **insurance fund**.
* The **liquidation engine** fails to close a liquidated position at or above the **bankruptcy price**.
* The platform faces position imbalances due to **extreme volatility**, liquidity shortages, or **force majeure**.

When ADL is triggered, the system forcefully reduces the positions of users **with the highest leverage and return**, executing their trades against liquidated counterparties.

### **ADL Ranking System**

Traders are **ranked for ADL** based on their **leverage-adjusted returns**.

#### ADL Priority Indicator

Each position has an **ADL indicator light**, ranging from **1 to 5 bars**:

* **More bars = Higher ADL risk**
* **5 bars = Top of the ADL queue**

#### ADL Sorting Rules

* If the position is **profitable**:

$$
\text{Ranking Score} = \text{Profit %} \times \text{Effective Leverage}
$$

* If the position is **losing**:

$$
\text{Ranking Score} = \frac{\text{Profit %}}{\text{Effective Leverage}}
$$

**Effective Leverage:**

$$
\text{Effective Leverage} = \left| \frac{\text{Mark Price}}{\text{Mark Price} - \text{Bankruptcy Price}} \right|
$$

### **Profit Percentage Formulas**

#### **Forward Contracts**

* **Long**:

$$
\text{Profit %} = \frac{\text{Mark Price} - \text{Entry Price}}{\text{Entry Price}}
$$

* **Short**:

$$
\text{Profit %} = \frac{\text{Entry Price} - \text{Mark Price}}{\text{Entry Price}}
$$

#### **Reverse Contracts**

* **Long**:

$$
\text{Profit %} = \frac{\text{Entry Price} - \text{Mark Price}}{\text{Entry Price}}
$$

* **Short**:

$$
\text{Profit %} = \frac{\text{Mark Price} - \text{Entry Price}}{\text{Entry Price}}
$$

### **When is ADL Triggered?**

When a **liquidated position** cannot be closed at or above the **bankruptcy price**, even after using **insurance fund compensation**, the platform activates the **ADL engine**.

* The ADL system selects top-ranked counterparties from the **opposite direction** to match and settle the position.
* ADL executes trades **at the post-compensation price**.

#### Margin Modes:

* **Isolated Margin**: Long and short positions may both be subject to ADL.
* **Cross Margin**: Only **unhedged** portions of positions are subject to ADL. **Fully hedged** positions are **not affected**.

> ⚠️ **No trading fees** are charged for positions closed via ADL.

### **ADL Execution & Notifications**

Once ADL is completed:

* The corresponding position is **closed**.
* The profit from the position is **added to the account balance**.
* Users receive **email/SMS notifications**.
* A record labeled **"ADL"** appears in the trade history.
* Users are **free to re-enter the market**.

### **Example: BTC/USDT Contract**

* **Trader Balance**: 10,000 USDT
* **Position**: Long 5 BTC at 20,000 USDT with 10× leverage
* **Liquidation Price**: 19,090 USDT
* **Bankruptcy Price**: 19,000 USDT
* **Post-Insurance Price**: 18,090 USDT

If the liquidation engine cannot close the position at or above **18,090**, the **ADL system takes over**.

Assuming the platform has **5 short (opposite) positions**, here’s how ADL prioritizes them:

<table><thead><tr><th width="115.20001220703125">User</th><th width="123.4000244140625">Short BTC</th><th width="178.199951171875">ADL Ranking Score</th><th width="296.79986572265625">ADL Rank Tier</th></tr></thead><tbody><tr><td>A</td><td>3</td><td>5</td><td>Top 0–20% (🟧🟧🟧🟧🟧)</td></tr><tr><td>B</td><td>3</td><td>4</td><td>Top 20–40% (🟧🟧🟧🟧)</td></tr><tr><td>C</td><td>2</td><td>3</td><td>Top 40–60% (🟧🟧🟧)</td></tr><tr><td>D</td><td>2</td><td>2</td><td>Top 60–80% (🟧🟧)</td></tr><tr><td>E</td><td>3</td><td>1</td><td>Top 80–100% (🟧)</td></tr></tbody></table>

→ **User A’s 3 BTC** and **User B’s 2 BTC** are used to absorb the liquidated long.\
→ **User B’s remaining 1 BTC** is not affected.

### **Reducing ADL Risk**

While ADL is rare and only triggered during **extreme volatility**, traders can reduce ADL risk by:

* **Lowering leverage**: Reduces ADL rank instantly
* **Reducing position size**: Especially helpful for highly profitable positions
* **Using cross-margin hedging**: Fully hedged positions are **ADL-protected**
