# Insurance Fund

### **What Is the Insurance Fund?**

The **insurance fund** is a risk management reserve used to **cover losses** from forced liquidations in extreme market conditions. Its primary goal is to **reduce the likelihood of Auto-Deleveraging (ADL)**, thereby protecting users from involuntary position reductions.

### **How Are Insurance Funds Generated?**

Insurance funds grow through **profits realized by the liquidation engine**.

#### Process:

1. When a position is liquidated, the **liquidation engine** takes over the user's position and remaining margin at the **bankruptcy price**.
2. If the liquidation engine can **close the position at a better price** than the bankruptcy price:
   * A **profit** is generated.
   * This profit is **injected into the insurance fund**.

$$
\text{Profit} = (\text{Exit Price} - \text{Bankruptcy Price}) \times \text{Position Size}
$$

> These accumulated profits serve as a **buffer** for future liquidation losses.

### **How Are Insurance Funds Used?**

During liquidation:

1. The liquidation engine assumes the position at the **bankruptcy price**.
2. If the position cannot be closed without loss, the **insurance fund compensates** the difference between the **actual closing price** and the **bankruptcy price**.
3. This compensation:
   * Reduces the loss from liquidation.
   * Helps avoid triggering **Auto-Deleveraging (ADL)**.
4. If the loss **exceeds the insurance fund's coverage**, and no counterparties are available to absorb the loss, **ADL is triggered**.

### **Shared Fund Across Contracts**

All **perpetual contracts** that use the **same margin currency** (e.g., USDT) share a **single insurance fund**. This improves capital efficiency and provides broader protection across multiple markets.

#### Example:

* A trader's BTC/USDT long position is liquidated.
* The **bankruptcy price** is $28,000.
* The liquidation engine closes the position at $28,200.
* The $200 profit per BTC (after costs) is added to the **insurance fund**.
* In a future event, if a liquidation results in a closing price **below** the bankruptcy price, the fund **absorbs the loss**, reducing ADL risk for all users.


---

# 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.coinlocally.com/perpetual-contracts/overview/insurance-fund.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.
