# PnL and closing

Source: https://docs.mog.xyz/trading/pnl-and-closing/

Markdown: https://docs.mog.xyz/trading/pnl-and-closing.md

Reviewed protocol version: 6.0.1

Protocol review date: 2026-09-18

Scope: reviewed public documentation. Numerical examples use illustrative or launch settings; they are not live quotes or a guarantee of current deployed parameters. Consult the app for current market and position values.

You can close all or part of a position. Your position size and the price move determine raw PnL; a profitable close applies Mog's **close curve**, then the settlement fee.

## How the close curve works

The close curve helps trading activity build Mog's liquidity. Larger favorable moves settle a greater share of raw profit, reaching the full profit cap at the payout price. The settlement fee applies afterward.

The curve also limits profit from small, short-lived distortions in oracle prices.

## Why the curve differs by market

Each market has a setting called **c**, its reference distance. It shapes the close curve: a higher c means a larger favorable move is needed for the same share of profit on the reference curve below.

Select an asset and move across the plot to explore it. Each position keeps the c set when it filled.

Reference close curve

Reference curve: `retained fraction = move² / (move² + c²)`. Both move and c are price fractions; 0.15% = 0.0015. Multiply the fraction by 100 for a percentage.

Illustrative c = 0.0015 (0.15%); this is not a live market quote or current parameter lookup. This reference curve excludes the position-specific cap adjustment and settlement fee. The full position formula follows below.

| Favorable move | Raw profit retained before fees |
| -------------- | ------------------------------- |
| 0%             | 0%                              |
| 0.15%          | 50%                             |
| 0.3%           | 80%                             |
| 0.5%           | 91.74312%                       |

The plot isolates c. A position's full curve also accounts for the distance from entry to its payout price. Test settings are labeled; the plot shows values before fees.

**View the close formulas**

For a favorable price move $\Delta$, the reference plot shows this fraction of raw profit:

$$
p_{\mathrm{ref}}=\frac{\Delta^2}{\Delta^2+c^2}
$$

The full position formula is:

$$
W=\frac{\Pi^3}{\min\left(r^2,\;\Pi^2+(Nc)^2\right)}
$$

$N$ is position size and $\Pi=N\Delta$ is positive raw PnL, limited to the profit cap $r$. $W$ is settled profit before fees. Both $\Delta$ and $c$ are price fractions: 0.15% is 0.0015.

Losing closes realize the loss directly, limited to active collateral. Reaching the payout price settles the full profit cap before fees. On-chain rounding can slightly reduce calculated amounts.

## Closing a position

A close uses a later [oracle price update](https://docs.mog.xyz/trading/positions-and-leverage/#from-order-to-fill), so the market can move after you submit. If the price touches your liquidation or payout price first, that closes the position instead.

If an update exceeds the oracle delivery staleness limit, it voids the pending close request. The position remains open unless a recorded barrier touch closes it. Review the position and submit a new close if needed.

A partial close reduces position size, collateral, and the profit cap by the same proportion. The remaining position keeps its liquidation and payout prices. A remainder below the minimum size, or below 50× effective leverage after rounding, triggers a full close. The close preview shows when this applies.

[Adding margin](https://docs.mog.xyz/trading/adding-margin/) leaves the profitable-close curve unchanged.

## Your balance after closing

Your remaining cash margin returns to your balance. With enough treasury cash, profit after [fees](https://docs.mog.xyz/trading/fees/) is available as cash at settlement. Only an unfunded amount enters [the payout queue](https://docs.mog.xyz/account/payout-queue/).

## When a market retires

You can request a close during the market’s drain period. Once its final oracle record is posted, new close requests stop. That record settles remaining positions at their barrier or the final mark; a pending close request does not survive retirement.
