# FAQ

### **I entered a long YT position. Why do I also have a negative ST position?**

The RateX AMM is constructed with a YT/ST pair. This means you need to use ST to exchange for YT. When a trader wants to long YT, they borrow some ST from the protocol, perform the swap, then use the swapped YT and deposited margin as collateral for the borrowed ST. The borrowed ST is displayed as a negative position.

On the other hand, when a trader enters a short YT position, a long ST position will also be displayed for the same reason.

### **How is PnL calculated?**

PnL is calculated based on the following equation:

$$
\text{PnL} = \text{YT\_Position} \times (\text{YT\_Price}*{\text{current}} - \text{YT\_Price}*{\text{entry}})
$$

The entry price is expressed by:

$$
\text{YT\_Price}\_{\text{entry}} = - \frac{\text{ST\_Position}}{\text{YT\_Position}}
$$

The PnL% shows the ratio of PnL to the deposited margin:

$$
\text{PnL%} = \left( \frac{\text{PnL}}{\text{Deposited Margin}} \right) \times 100%
$$

### **Why does my entry price change?**

At the end of each yield calculation time interval, issuers of YTs and STs distribute the yield to holders based on the actual rate of return. For example, a trader with a long YT position would receive the accrued yield paid in ST, which would be used to offset the borrowed ST position automatically and result in a change in the ST position. The process can be described in the following equations:

$$
\text{New ST\_Position} = \text{Old ST\_Position}+ \text{DistributedYield}
$$

where the Distributed Yield is calculated by:

$$
\text{DistributedYield} = (\text{Old ST\_Position} + \text{YT\_Position}) \times \text{ActRtn}
$$

where ActRtn indicates the actual rate of return of the yield calculation time interval. Since the  ST position changes due to the yield distribution, the entry price changes accordingly.

### **Why is the maximum leverage sometimes less than 10 times?**

RateX uses a Time-Weighted Average Price (TWAP) Collateral Ratio (CR) to determine if liquidation should be triggered. Sometimes, especially when the YT price significantly rises or falls, the margin may meet the Initial CR, which uses the current price, but fail to meet the Maintenance CR, which uses the TWAP price. In such cases, RateX lowers the maximum leverage to prevent immediate liquidation.

<br>


---

# 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/faq.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.
