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

# Margin & Leverage

> How margin, leverage, and collateral work.

Perpetra uses **cross-margin**: your entire balance backs all positions. No isolated margin—your account is one pool of collateral.

## Key Concepts

**Collateral** — USDC you deposit. Backs your positions and covers losses.

**Initial Margin (IM)** — Margin required to open a position. Depends on size and leverage. Higher leverage = lower IM per unit of notional.

**Maintenance Margin (MM)** — Minimum margin to keep a position open. If your margin ratio drops below MM, you're liquidated.

**Free Collateral** — Collateral available for new positions or withdrawals. = Total collateral − Initial margin on open positions.

## Leverage

| Market        | Max Leverage |
| ------------- | ------------ |
| BTC, ETH, SOL | 100x         |
| Major alts    | 20x          |
| Other alts    | 10x          |

Leverage amplifies gains and losses. 10x long that moves 10% against you = 100% loss of margin. Start low until you're comfortable.

<Tip>
  Larger positions face higher effective margin requirements. The system scales IM/MM with size to manage risk.
</Tip>

## Margin Ratio

**Margin Ratio = Total Collateral / Total Position Notional**

Higher ratio = safer. If it drops below the maintenance margin ratio, liquidation kicks in.

## Withdrawing

You can withdraw **free collateral** only. Collateral locked as initial margin stays until you reduce or close positions. Unrealized profits don't count as withdrawable until you settle PnL.

Formula: **Withdrawable = Balance − Initial Margin − Positive Unrealized PnL**

Settling PnL moves profits into your balance, making them withdrawable.

## Formulas (Reference)

<AccordionGroup>
  <Accordion title="Total Collateral">
    `Total Collateral = Balance + Unrealized PnL`
  </Accordion>

  <Accordion title="Free Collateral">
    `Free Collateral = Total Collateral − Initial Margin − Pending Short USDC`
  </Accordion>

  <Accordion title="Liquidation Condition">
    Account is liquidated when Margin Ratio \< Maintenance Margin Ratio
  </Accordion>
</AccordionGroup>
