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
  • ETH/USD Spot oracle:
  • stETH/ETH Spot oracle:
  • stETH/USD Anchor Price oracle:
  • The Algorithm of stETH/USD Max and Min Price:
  • Price Checking Mechanism:
  • Conclusion:
Export as PDF
  1. RISK MANAGEMENT
  2. Oracle

stETH

Learn more about f(x) V2 oracle mechanism.

The f(x) 2.0 price oracle mechanism for stETH/USD combines multiple data sources, including Chainlink, Uniswap, Curve, and Balancer, to calculate spot prices and anchor prices. It defines Max and Min Price for stETH/USD based on these sources and uses a governance-adjustable threshold (default 1%) to decide whether to rely on the Anchor Price or the Max/Min Price for operations like rebalancing, minting, or redeeming. This ensures accurate and stable pricing while accommodating market fluctuations. Below is the detailed breakdown of the stETH Spot Price Oracle Mechanism:

ETH/USD Spot oracle:

  1. https://data.chain.link/feeds/ethereum/mainnet/eth-usd

  2. https://info.uniswap.org/#/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640

  3. https://info.uniswap.org/#/pools/0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8

  4. https://v2.info.uniswap.org/pair/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc

stETH/ETH Spot oracle:

  1. [stETH/ETH Curve Spot]

  2. [stETH/ETH Univ3 Spot]

  3. [stETH/ETH Balancer Spot]

  4. [stETH/ETH Curve2 Spot]

stETH/USD Anchor Price oracle:

  • [stETH/ETH Curve EMA ]*[ETH/USD Chainlink Spot]

The Algorithm of stETH/USD Max and Min Price:

  • Max: stETH/USD Price=Max(Anchor Price, [stETH/ETH Spot Max Price ]* [ETH/USD Spot Max Price ])

  • Min: stETH/USD Price=Min(Anchor Price, [stETH/ETH Spot Min Price ]* [ETH/USD Spot Min Price ])

Price Checking Mechanism:

  • Anchor Price is used, while the price difference between Anchor Price and Max/Min Price exceeds the threshold

  • The threshold is a governed parameter, 1% in default

Conclusion:

  • Min stETH/USD Price is used for Open/Close of xPOSITION risk control, Rebalance and Liquidation if the price difference between Anchor Price and Min Price doesn’t exceed the threshold. Anchor Price is used otherwise.

  • Max stETH/USD Price is used for Redeeming fxUSD if the price difference between Anchor Price and Max Price doesn’t exceed the threshold. Anchor Price is used otherwise.

PreviousOracleNextWBTC

Last updated 5 months ago

🧭