> 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/pnl-and-closing.md).

# PnL and closing

## Entry price

```
entryPrice = sizeInUsd / sizeInTokens
```

Your entry price is the **execution price you actually filled at**, spread included — not the oracle mid at the moment you clicked. It is recorded once and never re-marked. Every subsequent PnL and liquidation calculation references it.

## Unrealized PnL

```
LONG   unrealized PnL = sizeInTokens · oraclePrice − sizeInUsd
SHORT  unrealized PnL = sizeInUsd − sizeInTokens · oraclePrice
```

This is **pure price PnL**. It excludes funding, closing fees, and closing price impact.

**ROE** = unrealized PnL ÷ initial margin.

## What you actually receive

```
Est. receive ≈ collateral + unrealizedPnL + closingImpact − closingFee − pendingFunding
```

| Term             | What it is                                                                                                                                                                  |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `closingImpact`  | The price impact of unwinding into the vault. Only realized on close, so it never appears in unrealized PnL. Can be positive if your close improves the market's imbalance. |
| `closingFee`     | The position fee on the closing side. See [fees](/fx100-docs/how-the-system-works/fees.md).                                                                                 |
| `pendingFunding` | Funding accrued and not yet settled. Typically near zero. See [funding](/fx100-docs/how-the-system-works/funding.md).                                                       |

{% hint style="info" %}
The unrealized PnL at the top of the position panel answers "how has price moved against my entry". **Est. receive** answers "what lands in my balance if I close right now". The second number is the one to trade on.
{% endhint %}

The gap between them is largest on big positions in shallow markets, where closing impact dominates, and on small positions held a long time, where accrued funding dominates.

## Auto-deleveraging

During extreme volatility or heavily one-sided open interest, a deeply profitable position can be partially or fully closed early at the oracle price, as a solvency measure protecting liquidity providers. This is rare in normal conditions.

See [auto-deleveraging](/fx100-docs/how-the-system-works/adl.md).

## Closing a position

Closing is a market operation against the vault at the prevailing oracle price, subject to the same [dynamic spread](/fx100-docs/trading/pricing-and-execution.md) as opening — applied on the bid side for a long, the ask side for a short.

You can close partially. A partial close realizes a proportional share of PnL and charges the closing fee on the closed portion only. The remaining position keeps its original entry price.

{% hint style="warning" %}
Closing and reopening is the only way to get a fresh [liquidation protection window](/fx100-docs/start-here/liquidation-protection.md) — but it costs a close fee plus an open fee, and your new entry price will be the new execution price.&#x20;
{% endhint %}
