πCreating a Leveraged SHORT Position (sPOSITION)
sPOSITION is a non-fungible, high-beta leveraged short position that provides a powerful decentralized tool for on-chain high-leverage trading. When a user opens an sPOSITION, 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.
Hereβs how the process works:
1. Collateral Submission
The user provides collateral (fxUSD), which will be used to borrow directional collateral from the xPOSITION reserve.
2. Flash Loan for Collateral
The protocol employs flash loans to obtain the required amount of collateral (wstETH or WBTC) and sells it for fxUSD to back the leverage position, thus creating the short exposure. The flash loan and the position creation occur atomically, ensuring the entire transaction either executes completely or not at all, thus avoiding partial execution risks.
3. Borrowing directional assets from the xPOSITION reserve
The total fxUSD, consisting of both the userβs initial collateral and the flash loan-acquired fxUSD, is then deposited into the protocol to borrow the corresponding token (wstETH or WBTC) from the leverage long reserve. The borrowed collateral asset is immediately used to repay the flashloan, thereby establishing the userβs short position without requiring upfront access to the borrowed asset.
4. sPOSITION Creation
Once the collateral is secured through flash loans, the leveraged position (sPOSITION) is activated. At this stage, the user gains leveraged short exposure to the underlying assets, and their position is opened.
Last updated