# Profit and Loss (PnL)

## **PnL of Leveraged Yield Trading Positions**

The PnL (Profit or Loss) of a position can be calculated by summing the changes in the value of Standard Tokens (STs) and Yield Tokens (YTs). Since changes in ST value are already reflected in the entry price, the PnL can be more easily derived solely from the change in YT prices. The following equations illustrate this concept:

For Long Yield Positions:

$$
\text{Unrealized PnL} = \text{AmountYT} \times (\text{CurrentPrice} - \text{EntryPrice})
$$

For Short Yield Positions:

$$
\text{Unrealized PnL} = \text{AmountYT} \times (\text{EntryPrice} - \text{CurrentPrice})
$$


---

# 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://docs.rate-x.io/ratex/getting-started/yield-trading/profit-and-loss-pnl.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.
