# The f(x) Invariant

The f(x) Invariant is the core mechanism behind both V1 and V2. It enables on-chain leverage while delivering 100% capital efficiency for the stablecoins.\
\
f(x) Protocol ensures that the total value of all fxUSD combined with the total value of all xPOSITIONs is always equal to the total value of the collateral reserves. Dynamic adjustments to the leverage ratio of xPOSITION and the peg ratio of fxUSD enable seamless collaboration between low-volatility stablecoins and high-leverage trading tools.

The relationship is represented as:

<img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXchdsHtOfLmBKidgm_bD95kHTUF0OBdfRALofMxDEajA5z6BSoHX42FOpRY4HQcw4wfneOcxrwd58b4ZgEujgCjc7HNuZREDkDMCSmZj2185By90016vCQ8T5zDSuLICDQb0rQI?key=qZd1xwlrsRmRqxNUnTlo-b4A" alt="" data-size="original">

Where:

𝑛 is the number of TOKEN collateral,&#x20;

𝑠 is the TOKEN price in USD,&#x20;

​nf is the number of fxUSD,&#x20;

𝑓  is the fxUSD NAV in USD,&#x20;

nx is the number of xPOSITION units, and&#x20;

𝑥 represents the NAV of xPOSITION in USD.

This formula ensures that the system remains balanced, maintaining integrity and stability across its decentralized financial tools.

\
\
\
\
\
\
\
\\
