> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jup.ag/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs cover what users see and do on jup.ag, Jupiter Mobile and Jupiter Wallet.
> Universal Deposit, the GUM route in Jupiter Bridge and other GUM integrations on jup.ag are built by GUM. For how they work, their full fee rules, security model and APIs, the reference is the GUM docs: start from https://docs.gum.ag/llms.txt.
> When the GUM docs and these docs differ on how a GUM product behaves on jup.ag, describe the jup.ag experience from these docs and the mechanics and fees from the GUM docs.

# Liquidation

> How liquidation works on Jupiter Perps: what triggers it, how the liquidation price is calculated, how it changes over time, and how to avoid it.

This page explains the liquidation mechanism on Jupiter Perps: what triggers it, how the liquidation price is calculated for long and short positions, how it drifts over time, and how to manage your risk.

## What Is Liquidation?

> [!NOTE]
>
> This page describes the JLP markets (SOL, ETH, BTC). On [Beta markets](https://docs.jup.ag/user-docs/trade/perps/beta-markets.md#liquidation), a position is liquidated when the mark price reaches its liquidation price, the maintenance margin depends on the position's [risk tier](https://docs.jup.ag/user-docs/trade/perps/beta-markets.md#liquidation), a liquidation fee applies, and whatever collateral remains after the loss and fees is returned to you rather than kept by a pool; in a fast market, it can be little or nothing.

Liquidation is the automatic closure of a position by the protocol when the trader's collateral is no longer sufficient to cover the outstanding losses and fees. It is triggered when the oracle price reaches the position's **liquidation price**.

> [!WARNING]
>
> When a position is liquidated, **all remaining collateral is taken** as a liquidation fee, after the loss, the close fee and borrow fees. You will not receive any portion of your collateral back. Only deposit collateral that is within your risk tolerance.

***

## Liquidation Trigger

| Position | Liquidation occurs when |
| - | - |
| Long | Oracle price **falls below** the liquidation price |
| Short | Oracle price **rises above** the liquidation price |

***

## Liquidation Price Formula

The liquidation price is the oracle price at which the position's effective collateral (after fees) equals the minimum margin required by the protocol.

### Long Position

```text theme={null}
Liquidation Price (Long) =
  price - ((collateral_size
            - close_fee
            - borrow_fee
            - (size / max_lev))
           * price) / size
```

### Short Position

```text theme={null}
Liquidation Price (Short) =
  price + ((collateral_size
            - close_fee
            - borrow_fee
            - (size / max_lev))
           * price) / size
```

If the fees exceed `collateral_size - (size / max_lev)`, the bracket becomes negative and the liquidation price moves past the entry price: above it for a long, below it for a short. A position can then be liquidated without any adverse price move.

### Variable Definitions

| Variable | Definition |
| - | - |
| `price` | Average entry price (USD) of the position |
| `collateral_size` | Collateral recorded on the position (USD), fixed at deposit, after opening fees |
| `close_fee` | Close fee (USD) on the position size: base fee + linear price impact fee. Liquidations do not pay the [additive price impact fee](https://docs.jup.ag/user-docs/trade/perps/fees.md#additive-price-impact-fee) |
| `borrow_fee` | Accumulated borrow fees (USD) to date |
| `size` | Position size (USD) |
| `max_lev` | Protocol-level maximum leverage: **500** |

> [!NOTE]
>
> `max_lev` in the formula refers to the **protocol limit of 500x**, which is used to define the minimum maintenance margin. This is distinct from the **250x trading maximum** available when opening a position.

***

## How the Liquidation Price Changes Over Time

The liquidation price is **not static**. It moves as fees accumulate:

* **Borrow fees** accrue continuously and count against your collateral in the liquidation price, which drifts toward the current market price. They are settled from your collateral when you change or close the position.
* The effect is most significant at **leverage above 10x** and for positions held over extended periods.

> [!WARNING]
>
> A position that appears safely distant from liquidation when opened can approach its liquidation price over time due to borrow fee accumulation, even without any price movement.

***

## Liquidation Example

**Setup:** \$10,000 collateral long position approaching liquidation

| Item | Value |
| - | - |
| Position collateral | \$10,000 |
| Remaining collateral after loss + fees | \$1,000 |
| Liquidation fee | \$1,000 (the entire remaining collateral) |
| Returned to trader | \$0 |

***

## How to Avoid Liquidation

> [card] Monitor your liquidation price
>
> Check the Positions tab regularly, especially during volatile market conditions or for long-duration positions.

> [card] Deposit additional collateral
>
> Adding collateral reduces leverage and moves the liquidation price further from the current market price. Use the pencil icon in the **Collateral** column of any open position.

> [card] Use Stop Loss orders
>
> A stop loss can close the position before it reaches the liquidation price and keep part of your collateral. Execution is not guaranteed: the form warns when the stop loss is too close to the liquidation price, and in fast markets the position can be liquidated first.

> [card] Reduce leverage
>
> Lower leverage means a larger price movement is required before liquidation is triggered.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.