> For the complete documentation index, see [llms.txt](https://docs.upscale.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.upscale.trade/trade-mechanics/pnl_and_roi.md).

# PnL and ROI

In perpetual futures trading, key metrics like Return on Investment (ROI) and Profit and Loss (PnL) are essential. These metrics serve as critical indicators of a trader's performance and financial outcomes. This documentation aims to elucidate the concepts of ROI and PnL, focusing on both realized and unrealized aspects, and underscores the impact of fees, including open/close position fees, funding fees.

## 💸 Return on Investment (ROI)

ROI is a fundamental metric employed in trading to assess the profitability of an investment. It quantifies the return generated relative to the initial capital invested. In perpetual futures trading, ROI is an invaluable tool for evaluating the efficacy of trading strategies.

The formula for calculating ROI is as follows:

```js
ROI = ((Final Value - Initial Investment) / Initial Investment) * 100
```

In this context:

* `Initial Investment` represents the capital allocated to a trading position.
* `Final Value` encompasses both realized and unrealized gains or losses.

## 🧮 Realized and Unrealized PnL

Profit and Loss (PnL) in perpetual futures trading can be categorized as realized and unrealized.

**Realized PnL**: This metric signifies the actual profits or losses realized upon closing a trading position. It factors in the difference between the entry price and exit price, accounting for associated fees, including open/close position fees, funding fees. Realized PnL provides a precise depiction of the financial outcome of a particular trade.

**Unrealized PnL**: In contrast, unrealized PnL denotes the potential profits or losses linked to open positions that have not yet been closed. These gains or losses fluctuate with market price movements but remain unrealized until the position is closed. Unrealized PnL is a dynamic metric that responds to evolving market conditions.

## 💡 Impact of Fees on PnL

Fees exert a significant influence on realized PnL. Notably, the following fees must be considered:

* **Open/Close Position Fees**: These fees are incurred when initiating and closing positions, directly affecting the realized PnL of each trade.
* **Funding Fees**: Perpetual futures contracts entail funding payments exchanged between long and short traders to maintain alignment with the underlying asset's market price. Funding fees contribute to realized PnL.
* **Spread Costs**: Traders effectively buy at the ask and sell at the bid, which can lead to an immediate unrealized loss upon entering a position. This loss affects the net profitability and should be considered, especially in fast-moving or illiquid markets.

🏄 *Upscale's transparent fee structure lets your ROI and PnL tell the full story of your trading prowess.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.upscale.trade/trade-mechanics/pnl_and_roi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
