# Position PNL Calculation

Profit calculation is based on all orders or remaining tokens in the position.

<figure><img src="https://554260309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeAkMGtCw51BYWLVdmuDx%2Fuploads%2F43JMfybxIlNmtnkuMcqW%2Fimage.png?alt=media&#x26;token=7274a919-5a4c-4e50-98f0-353d3ab7e5aa" alt=""><figcaption></figcaption></figure>

PNL calculation process varies based on the position type. Below are the formulas for each type.

## 1. Based on all orders

**PnL** includes **ALL** realized profit/loss from partial position closing + the estimated profit/loss that would be realized if the position were closed at the current price.

{% hint style="info" %}
**PNL = \[(Partial closing volume + (Current price x Position quantity)) - Opening volume] x Direction - Commission + Funding**
{% endhint %}

> Direction = 1 if **LONG**\
> Direction = -1 if **SHORT**

Example with a **0.1%** commission:

1. trader buys 1 BTC at 20.000 USDT.
2. sells 0.8 BTC at 25,000 USDT (partial profit will be 4,000 excluding commissions).

Total position PnL at current exchange rate 22,000 USDT will be calculated as follows:

{% hint style="info" %}
**PnL = (25 000 x 0.8 + 22 000 x 0.2 - 20 000 x 1 ) x 1 - ( 25 000 x 0.8 + 22 000 x 0.2 + 20 000 x 1 ) x 0.001 = 4355.6 USDT**
{% endhint %}

In this example, with no funding rate, the profit would either increase or decrease based on the sign of the funding amount.

## 2. Based on remaining position coins

PnL is calculated based only on the remaining coins in the position when it is closed at the current price.

{% hint style="info" %}
**PNL = (Current Price - Position Price) x Position Quantity) - Commission + Funding**
{% endhint %}

> Direction = 1 if **LONG**\
> Direction = -1 if **SHORT**

Example with 0.1% commission:

1. trader buys 1 BTC at 20,000 USDT.
2. sells 0.8 BTC at 25,000 USDT (partial profit will be 4,000 excluding commissions).
3. The position price is equal to the entry price (if the position price calculation formula excluding partial closing is enabled).

The PnL for the remaining 0.2 BTC, at the current exchange rate of the currency pair, which is 22,000 USDT, will be calculated as follows:

{% hint style="info" %}
**PnL = (22 000 - 20 000) x 0.2 - 22 000 x 0.2 х 0.001 х 2 = 391.2 USDT**
{% endhint %}

In this example, with no funding rate, the profit would either increase or decrease based on the sign of the funding amount.

## Additional information

* Funding rate in hedging mode will be divided in half if both **Long** and **Short** positions are open simultaneously on the same currency pair.
* **PNL** will not be displayed correctly if a position mismatch has occurred. These positions cannot be considered for trading and the trader must manually define the **PNL** position.

## FAQ

* [If I have an open position in BTC, how can I buy some BTC and withdraw them without affecting the total PNL of the position?](#if-i-have-an-open-position-in-btc-how-can-i-buy-some-btc-and-withdraw-them-without-affecting-the-tot)

#### If I have an open position on BTC, how can I buy a portion of BTC and withdraw it without affecting the overall PNL of the position?

This option is not available in the terminal.

**Do you have any questions? We can help you in our Telegram chat.**

{% embed url="<https://t.me/finandy>" %}
