xPOSITION is a non-fungible, high-beta leveraged long position that provides a powerful decentralized tool for on-chain high-leverage trading. When a user opens an xPOSITION, the process is seamlessly facilitated through the use of a flash loan. This is executed via an atomic transaction, ensuring that all steps are completed successfully or the entire transaction is reverted, preserving the integrity of both user funds and the protocol.
The user provides collateral (e.g., stETH), which is used to mint fxUSD, the protocol's stablecoin, and fund the leverage mechanism.
The protocol employs flash loans to obtain the required amount of collateral to back the leverage position. The flash loan and the position creation occur atomically, ensuring the entire transaction either execute completely or not at all, thus avoiding partial execution risks.
For every unit of xPOSITION, the protocol mints the required amount of fxUSD to manage volatility and maintain full collateralization. For example, a 10x leveraged position will have 1 unit of xPOSITION backed by 9 units of fxUSD. Meanwhile, the underlying collateral remains in stETH, harnessing its yield while maintaining the desired leverage ratio.
Once the collateral is secured through flash loans and the necessary fxUSD is minted, the leveraged position (xPOSITION) is activated. At this stage, the user gains exposure to the underlying assets, and their position is opened.