# The f(x) Invariant

f(x) Protocol ensures that the total value of all fxUSD combined with the total value of all xPOSITIONs always equals the total value of the collateral reserves. Dynamic adjustments to the leverage ratio of xPOSITION and the pegging ratio of fxUSD ensure collaboration between zero-volatility stablecoins and high-leverage tools.

$$
ns = n\_ff+n\_xx
$$

Where 𝑛 n is the number of TOKEN collateral, 𝑠 is the TOKEN price in USD, ​nf is the number of fxUSD, 𝑓  is the fxUSD NAV in USD, nx is the number of xPOSITION units, and 𝑥 represents the NAV of xPOSITION in USD.


---

# 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.aladdin.club/f-x-protocol-new/f-x-2.0/the-f-x-invariant.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.
