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

# Closing a Position

> How to close a perpetual position fully or partially on Yellow.pro, and what happens to your margin and realized PnL.

Closing a position locks in your **Realized PnL** and releases its margin back to your Available Balance. There are two ways to close: a one-click market close, or a controlled close through the order form.

## Quick Close (the ✕ button)

Clicking the **✕** next to a position in the **Positions** panel places an immediate **market order** to close the **entire** position — there are no order-type or amount options. It fills against the best available prices straight away; if there isn't enough liquidity to match it, it fills **partially** and the remainder **expires**. It's the fastest way out, with the least control — use it when you just need to exit.

![Closing a position with the ✕ button in the Positions panel](https://mintcdn.com/yellow-pro/5hKhJ6IWCo2yF4ic/images/closing-a-position-with-the-button-in-the-positi.png?fit=max\&auto=format\&n=5hKhJ6IWCo2yF4ic\&q=85\&s=f765a5ba60fabef6c88c05f9f8e99229)

## Controlled Close (order form → Close tab)

For full control — including partial closes and specific exit prices — close through the order form instead of the ✕ button:

1. Switch the order form to the **Close** tab.
2. Choose the order type: **Market**, **Limit**, or **Stop**.
3. Enter the **amount** to close — your full size, or less for a partial close.
4. Confirm.

A **Limit** close lets you exit at a specific price or better (e.g. a take-profit level); a **Stop** close triggers at a price you set. A **partial** close leaves the rest of the position open at the original entry price, with margin adjusting proportionally. Resting limit or stop closes wait in **Open Orders** until they fill or you cancel them.

![Closing through the order form's Close tab](https://mintcdn.com/yellow-pro/5hKhJ6IWCo2yF4ic/images/closing-through-the-order-form-s-close-tab.png?fit=max\&auto=format\&n=5hKhJ6IWCo2yF4ic\&q=85\&s=ed578ed1d636d3fe0f55933b334fdcf2)

> **Example:** you hold 2 ETH long and close 1 ETH → your position becomes 1 ETH long, and half the margin is released.

> [!NOTE]
>
> Take Profit / Stop Loss orders must currently be set manually — they are not automatically linked to a position.

## Reduce only Orders

A **reduce-only** order is a flag you can add to an order to guarantee it can only close an existing position — it can never open a new one or increase the size of the one you already hold. It's a safety mechanism for exiting positions without any risk of accidentally flipping direction or adding exposure.

* **Position-aware validation** — before a reduce-only order is accepted, the system checks that you have an open position **in the correct direction** with enough available size to reduce.
* **Clear error guidance** — if you have no open position, or if the order side would increase rather than reduce it, you get a plain-language message explaining exactly what's wrong.
* **One-Way aware** — in [One-Way Mode](https://docs.yellow.pro/perpetual-trading/long-short-hedge-mode.md), a reduce-only order automatically resolves to the correct leg based on your net position direction.

**When to use:** you're placing a take-profit or stop order and want to be certain it can only ever shrink your position — never open a fresh one if your position has already closed.

> [!NOTE]
>
> Reduce-only is especially useful with resting limit or stop orders: if your position is already closed by the time the order triggers, a reduce-only order simply does nothing instead of opening an unwanted new position.

## After Closing

* **Realized PnL** is credited or debited from your balance (trading fees are deducted).
* The position leaves the Positions panel and the closed trade appears in **Trade History**.
* In cross margin, closing one position can affect the others — always check your remaining balance.

**Tip:** use the **✕ quick close** (market) to exit fast — e.g. to avoid liquidation; use a **Limit close** in the Close tab when you have a target price and aren't in a rush.

## Related Articles

* [Adjusting Margin & Leverage](https://docs.yellow.pro/perpetual-trading/position-management/adjusting-margin-and-leverage.md)
* [Understanding PnL](https://docs.yellow.pro/perpetual-trading/pnl.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.