# Creating a Leveraged LONG Position (xPOSITION)

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.

#### Here’s how the process works:

#### 1. Collateral Submission &#x20;

The user provides collateral (e.g., stETH or WBTC), which is used to mint fxUSD, the protocol's stablecoin, and fund the leverage mechanism.

#### 2. Flash Loan for Collateral &#x20;

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.

#### 3. Minting fxUSD &#x20;

For every unit of xPOSITION, the protocol mints the required amount of fxUSD to manage volatility and maintain full collateralization. For example, a 7x leveraged position will have 1 unit of xPOSITION backed by 6 units of fxUSD. Meanwhile, the underlying collateral remains in stETH or WBTC, harnessing its yield while maintaining the desired leverage ratio.

#### 4. xPOSITION Creation &#x20;

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.


---

# 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://fxprotocol.gitbook.io/fx-docs/f-x-protocol-mechanisms/creating-a-leveraged-long-position-xposition.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.
