βοΈ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:
Where:
π 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.
This formula ensures that the system remains balanced, maintaining integrity and stability across its decentralized financial tools.
WIth the addition of sPOSITION, the invariant evolved to ensure every fxUSD, xPOSITION and sPOSITION remained fully backed and that the protocol maintaines internal solvency across both long and short positions. The new invariant is:

Where:
π is the number of TOKEN collateral,
is the amount of TOKEN collateral borrowed for short positions,
π is the TOKEN price in USD,
nf is the number of fxUSD minted (longs),
f is the number of fxUSD locked (shorts),
X represents the NAV of xPOSITIONs in USD,
SP represents the total NAV of sPOSITIONs in USD.
Last updated