# PnL Calculation

Understanding Profit and Loss (PnL) is crucial to managing investments and making informed decisions. Traders have insight into the PnL of their past trades in the 'History' tab of their portfolio page at <https://trade.bluefin.io/portfolio/history>. &#x20;

**Unrealized PnL**: The profit and loss not yet realized from an open position. It is calculated as the difference between the entry and current mid-market prices multiplied by the position quantity.

$$\text{Unrealized PnL} = \begin{cases} \text{Position Size}\times \big(\text{Mid-Market Price} - \text{Entry Price}\big) \quad &\text{if Long}, \ \text{Position Size}\times \big(\text{Entry Price} - \text{Mid-Market Price}\big) \quad &\text{if Short}.\end{cases}$$

**Realized PnL**: The profit and loss that has already been realized from partially or fully closing the position. It is calculated as the difference between the entry and exit prices multiplied by the quantity closed.&#x20;

$$\text{Realized PnL} = \begin{cases} \text{Size Closed}\times \big(\text{Exit Price} - \text{Entry Price}\big)  \quad &\text{if Long}, \ \text{Size Closed}\times \big(\text{Entry Price} - \text{Exit Price}\big)   \quad &\text{if Short}.\end{cases}$$

### How to View PnL on Bluefin

You can access current and historical PnL metrics on Bluefin by visiting the account page [https://trade.bluefin.io/account](https://trade.bluefin.io/account?utm_source=learn-bluefin\&utm_medium=internal\&utm_campaign=pnl-calculation). Bluefin provides a user-friendly interface to view and manage your PnL across all open and closed perpetual positions.

To view your PnL metrics:

1. Access your account at [https://trade.bluefin.io](https://trade.bluefin.io/ETH-PERP?utm_source=learn-bluefin\&utm_medium=internal\&utm_campaign=pnl-calculation)
2. To view realized PnL, navigate to the Account History for a breakdown of all trades at [https://trade.bluefin.io/account/history](https://trade.bluefin.io/account/history?utm_source=learn-bluefin\&utm_medium=internal\&utm_campaign=pnl-calculation)&#x20;
3. To view unrealized position PnL, check the Positions table.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.bluefin.io/bluefin/bluefin-perps-exchange/trading/pnl-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
