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

# Position PNL

PNL in the context of crypto trading stands for "Profit and Loss." It is a key metric used to evaluate the performance of the position.

In Alfredo Trade bot, users can find Unrealized PNL in two scenes - the Wallet and Position Management.

<figure><img src="/files/GxGZ6jzyMyDg8rwK0AQp" alt="" width="375"><figcaption></figcaption></figure>

Notice: Users may find the Position info after clicking on a ticker symbol at the wallet scene or inputting the address of a token they have previously purchased.

The PNL calculation formula on the Wallet scene works as follows:

1. We calculate the **Average Buy Price** (gas is included in the price):&#x20;

`AVG buy price = (Σ(ETH_spent+Buy_TX_GAS+Approve_TX_GAS)) * ETH_price)/Σ(Tokens amount)`

2. The **Current Price** is calculated using a mathematical method that takes into account the price impact of selling the entire 100% quantity of tokens. It doesn't include sell taxes.
3. After that, we calculate the **PNL** with the following formula:

`PNL Amount = Tokens Amount * (Current Price - AVG buy price)`

`PNL (%) = Current_price/AVG Buy Price * 100`

<figure><img src="/files/cmTQaMEnfU5TsFdjY7EH" alt="" width="375"><figcaption></figcaption></figure>

It's essential to note that the PNL displayed in the Position scene differs due to the use of a selling simulation to calculate the Current Price. While simulation provides greater accuracy than a basic mathematical calculation, it's not feasible to integrate this method into the wallet scene due to the substantial costs associated with each simulation.


---

# 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.alfred.trade/alfred-documentation/using-alfredo-trade/position-pnl.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.
