> 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/insurance-fund.md).

# 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.
