fx Docs
  • f(x) Protocol Documentation
  • OVERVIEW
    • πŸ“–Abstract
    • ⭐Core Products of f(x) Protocol 2.0
  • f(x) Protocol Mechanisms
    • βš–οΈThe f(x) Invariant
    • βš™οΈKey Functions of f(x) 2.0
    • πŸš€Creating a Leveraged Position (xPOSITION)
    • πŸͺ‚Rebalancing the Position (Liquidation Brake)
      • Understanding the band system
      • Liquidation process
      • Developers
    • πŸ’°Stability Pool
    • πŸ’΅Fees
  • RISK MANAGEMENT
    • πŸ§˜β€β™‚οΈRisk framework
    • βœ…Advanced Peg Protection Mechanisms
      • Understanding the redemption mechanism
    • 🚨Risk parameters
    • 🧭Oracle
      • stETH
      • WBTC
    • πŸ›‘οΈAudit Reports
  • Earn with f(x)
    • πŸ’²USD high & sustainable yield
    • πŸͺ™$FXN Tokenomics
      • veFXN
      • FXN Farming and veFXN Boost
    • πŸ”₯Protocol Revenue & Distribution
  • POWER TO THE PEOPLE
    • 🀝Get involved - Community Booster Program
    • πŸ«‚Referral Program
  • FAQ
    • 🟦Is fxUSD an algorithmic stablecoin?
    • 🟦Where does the yield come from?
    • 🟦How do f(x) Protocol stablecoins maintain stability?
    • 🟦Is there any LUNA-like risk?
    • 🟦How does f(x) Protocol minimize liquidations?
    • 🟦How does f(x) Protocol minimize funding costs?
    • 🟦What could go wrong?
    • 🟦Why are there different stablecoins?
    • 🟦What is the difference between f(x) Protocol V1 and V2?
    • 🟦What price drop would it require for my xPOSITION to be rebalanced/liquidated?
  • GUIDES
    • πŸ“ˆHow to open a leverage position (xPOSITION)
    • πŸ“‰How to close a leverage position (xPOSITION)
    • πŸ“How to adjust your leverage / how to reduce your Liquidation Brake
    • βž•How to add/reduce a leverage position?
    • πŸ’°How to stake into the stability pool?
    • πŸšΆβ€β™‚οΈHow to unstake from the stability pool?
  • MORE
    • πŸ”‘Token Breakdown
    • 1️⃣f(x) Protocol 1.0
      • Leverage
      • Earn
      • Stability Mechanism
      • FX Auto-Compound
      • Oracle
    • πŸ–₯️Resources
      • Contracts
      • Useful links
    • πŸͺ”Aladdin DAO
    • 😎 Brand Assets
Powered by GitBook
On this page
Export as PDF
  1. f(x) Protocol Mechanisms

Creating a Leveraged 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

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

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

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

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.

PreviousKey Functions of f(x) 2.0NextRebalancing the Position (Liquidation Brake)

Last updated 2 months ago

πŸš€