> For the complete documentation index, see [llms.txt](https://ton-hedge.gitbook.io/ton-hedge-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ton-hedge.gitbook.io/ton-hedge-docs/providing-liquidity.md).

# Providing Liquidity

{% hint style="warning" %}
**Note!**

TON Hedge perpetual DEX is currently in its testnet phase. Its functionality is a subject of change.&#x20;
{% endhint %}

Liquidity for perpetual trading comes from users staking USDT in the liquidity pool, earning rewards from selling perpetuals. The pool grows from borrowing fees and trader losses, including liquidated position collateral.

Stakers receive LP tokens representing their share in the pool. **APY** depends on trading volume and total pool size.

In rare cases, withdrawals may be delayed if the request is too large relative to available liquidity. Funds unlock when enough perpetuals are closed or liquidated.

## Risk Management

Here, we outline key mechanics aimed at minimizing impermanent losses in the liquidity pool.

### Open Interest Limits

Open interest represents the total size of all open positions. To manage risk, open interest limits cap the total per pair relative to the liquidity pool, preventing imbalances that could affect PnL coverage and settlements, ensuring stability for liquidity providers.

The open interest limit is evenly divided between longs and shorts, with the total maximum open interest for a pair calculated as:

$$
MaxOI = PoolSize / PairCount
$$

### Auto Deleveraging (ADL)

If total pair PnL becomes too large, net exposure may exceed available liquidity. To ensure settlements, excess positions must be reduced, maintaining balance between the pool size and total pair PnL.

The **ADL factor** is **80%**, meaning if total PnL for a pair exceeds 80% of its max open interest, ADL is triggered and runs a loop:

1. The position with the highest PnL is automatically closed.
2. The process repeats until total PnL drops below 80% of max open interest.
