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

# Leverage and margin

How leverage is calculated, why the displayed number moves, and what the real cap is.

## Isolated margin

Every position is backed only by its own collateral. Risk does not spill between positions, and liquidating one has no effect on any other. A long and a short on the same asset are two independent positions with separate margin, separate liquidation prices, and separate protection windows.

Collateral is USDC (mock USDC for testnet).

## How leverage is calculated

Two different formulas appear in the interface, and they answer different questions.

```
Order preview:   leverage = orderValue / collateral
                 where orderValue = sizeInTokens · oraclePrice

Position panel:  leverage = sizeInUsd / (collateral − pendingFunding)
```

The position panel uses **net collateral** — collateral minus pending funding. Two consequences:

**Unrealized PnL is not in the denominator.** This is why the displayed leverage does not jitter as price moves. The number reflects your leverage against current net collateral, not against current equity.

**The displayed leverage can drift above your opening leverage.** As funding accrues, net collateral shrinks and the ratio rises. On a small position held for a long time, this is normal and not a sign that anything has gone wrong.

{% hint style="info" %}
For your actual risk, read the **liquidation price**, not the leverage number. Leverage is a ratio; the liquidation price is the thing that ends the position.
{% endhint %}

## Maximum leverage

Maximum leverage is set per market and ranges from 50x to 100x — see the [full table](/fx100-docs/markets/supported-markets.md). Even on a 100x market, the maximum you can actually open on a given order is a little lower, because spreads and fees consume part of the collateral requirement:

```
maxLeverage = 1 / (minCollateralFactor + s_open + s_close + f_open + f_close)
```

Where:

* `minCollateralFactor` — the minimum collateral ratio required to open, configured per market
* `s_open`, `s_close` — the dynamic spreads on each side
* `f_open`, `f_close` — the position fees on each side

In shallow liquidity, or on a large order, the openable leverage might be below the headline cap — the depth spread eats the room. The order preview shows the maximum currently available to you.

Both `minCollateralFactor` and the lower `minCollateralFactorForLiquidation` are configured per market. See [supported markets](/fx100-docs/markets/supported-markets.md) and [liquidation](/fx100-docs/how-the-system-works/liquidation.md).

## Adjusting a position

```
Adjust margin:    newMargin   = currentMargin ± amount
                  newLeverage = sizeInUsd / newMargin

Adjust leverage:  targetSize  = targetLeverage · collateral
                  sizeChange  = targetSize − currentSize
                  estFee      = |sizeChange| · positionFeeFactor
```

**Adding margin** moves the liquidation price away from current price. No fee — you are not changing notional size.

**Removing margin** moves the liquidation price closer. Available only while the position stays above the collateral requirement.

**Raising leverage** increases notional size. This is equivalent to adding to the position, and the position fee is charged on the increment only.

{% hint style="warning" %}
Adding to a position does not extend your [liquidation protection window](/fx100-docs/start-here/liquidation-protection.md). The 15 minutes are timed from the original open.
{% endhint %}

## Minimums

There is a minimum collateral amount and a minimum position notional, both configured per market. Orders below either threshold are rejected.
