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

# Liquidation

> How liquidation works, what triggers it, and how to avoid it.

## How Liquidation Works

We liquidate your position when your **health drops to 45%**.

**Health** measures how much equity you have left relative to your margin:

```
Health = (Position Value - Borrowed Amount) / Margin × 100%
```

When you open a position, health starts at 100%. As the market moves against you, health decreases. At 45%, we close your position.

```mermaid theme={null}
flowchart LR
    H100[100% Safe] --> H70[70% OK]
    H70 --> H55[55% Warning]
    H55 --> H45[45% Liquidated]
```

## Two-Phase Liquidation System

When a position reaches the liquidation threshold, we use a two-phase system designed to protect both the vault and the underlying market.

### Phase 1: Direct Liquidation

For **smaller positions**, we liquidate directly on Polymarket.

<Steps>
  <Step title="Position Sold">
    We sell your shares on Polymarket immediately
  </Step>

  <Step title="Vault Recovery">
    The vault recovers its borrowed capital
  </Step>

  <Step title="Margin Lost">
    You lose your remaining margin (no refund on liquidation)
  </Step>
</Steps>

This is fast and simple. For small positions, the market impact is negligible.

### Phase 2: Dutch Auction

For **larger positions**, selling directly on Polymarket would cause significant market impact—potentially triggering cascading liquidations or manipulating the underlying market. Instead, we run a **Dutch auction**.

<Info>
  **Why not just sell on Polymarket?** Large sells can move markets 5-10% or more. This hurts price discovery, can trigger other liquidations, and doesn't get the best recovery for the vault. The Dutch auction solves all three problems.
</Info>

#### How the Dutch Auction Works

```mermaid theme={null}
flowchart TB
    A[Position hits 45% health] --> B{Position size?}
    B -->|Small| C[Phase 1: Sell on Polymarket]
    B -->|Large| D[Phase 2: Dutch Auction]
    D --> E[Auction starts at discount]
    E --> F[Price decreases over time]
    F --> G[Liquidator accepts price]
    G --> H[Shares transfer to liquidator]
    H --> I[Vault recovers capital]
```

<Steps>
  <Step title="Auction Starts">
    The underwater position is listed at a starting discount from current market value
  </Step>

  <Step title="Price Decreases">
    The asking price decreases over time (the "Dutch" mechanism)
  </Step>

  <Step title="Liquidator Bids">
    The first liquidator to accept the current price wins the position
  </Step>

  <Step title="Shares Transfer">
    The position's shares transfer directly to the liquidator's account
  </Step>

  <Step title="Vault Recovers">
    The vault receives the liquidator's payment, recovering its lent capital
  </Step>
</Steps>

#### Why This Is Better

| Benefit                       | Explanation                                                              |
| :---------------------------- | :----------------------------------------------------------------------- |
| **No market impact**          | Shares transfer peer-to-peer, never hit Polymarket order books           |
| **No cascading liquidations** | Large sells can't trigger other positions to liquidate                   |
| **Better price discovery**    | Competitive auction finds fair value for distressed positions            |
| **Healthier ecosystem**       | Creates opportunity for liquidators, similar to DeFi liquidation markets |

<Note>
  **Position inherits the same close date.** If you buy a liquidated position via Dutch auction, you inherit its original time-boxing. The close date doesn't reset.
</Note>

#### Fallback to Phase 1

If no liquidator bids before the auction deadline, we fall back to Phase 1 and sell directly on Polymarket. This ensures positions are always closed promptly.

## What Happens to Your Margin

<Warning>
  **Liquidation is final.** There's no partial liquidation or margin call. Once you hit 45% health, the position closes entirely—either via direct sale or Dutch auction.
</Warning>

In both phases:

* The vault recovers its borrowed capital first
* Any auction discount or slippage comes from your remaining margin
* You lose your remaining margin (no refund on liquidation)

## Avoiding Liquidation

<CardGroup cols={3}>
  <Card title="Use Lower Leverage" icon="gauge-low">
    5x gives you roughly twice the buffer before liquidation compared to 10x.
  </Card>

  <Card title="Watch Your Health" icon="heart-pulse">
    The dashboard shows real-time health for all positions.
  </Card>

  <Card title="Close Manually" icon="arrow-right-from-bracket">
    If a trade isn't working, exit before liquidation locks in the maximum loss.
  </Card>
</CardGroup>

<Warning>
  **At 10x leverage, a \~5.5% move against you triggers liquidation.** Prediction markets can move 5% in minutes on breaking news. High leverage requires active monitoring.
</Warning>

## For Liquidators

Interested in participating in Dutch auctions? Liquidators play an important role in the Ultramarkets ecosystem by:

* Providing liquidity for distressed positions
* Earning discounts on positions they believe will recover
* Helping maintain system health without market impact

<Info>
  Liquidator documentation and API access coming soon.
</Info>
