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
  • Risk management
  • Net Asset Value
  • Additional protection measures for xTokens
  • [ETH/USD Spot] has 4 price sources, which are:
  • stETH New oracle:
  • frxETH New oracle:
  • weETH New oracle:
  • ezETH New oracle:
  • WBTC New oracle:
  • CVX oracle:
Export as PDF
  1. MORE
  2. f(x) Protocol 1.0

Oracle

Learn more about V1 oracle design.

PreviousFX Auto-CompoundNextResources

Last updated 4 months ago

Here is a breakdown of the key features and mechanisms of the oracle solution.

Enhanced collateral price feeds: In addition to the original TWAP, spot prices are incorporated, with additional price feeds from Curve, Uniswap V3, and Balancer.

Arbitrage prevention: Minting and redeeming transactions are conducted at different prices to eliminate arbitrage trades. This helps to protect the collateral held by the protocol.

  • fToken can be minted at the minimum price

  • fToken can be redeemed at the maximum price

  • xToken can be minted at the maximum price

  • xToken can be redeemed at the minimum price

Risk management

The collateralization ratio is calculated at the maximum price as well as stability pool liquidations. This ensures that risk is managed effectively and liquidations occur at appropriate levels to maintain system stability.

Net Asset Value

The NAV is calculated based on TWAP during the non-transacting periods. This NAV calculation can serve as an oracle price feed for various DeFi applications integrating f(x) assets.

Additional protection measures for xTokens

To prevent arbitrage trades, xTokens cannot be both minted and redeemed within the same block. Additionally, a transfer of xTokens cannot occur within a specified timeframe of thirty minutes after minting. These measures help in mitigating potential exploits and maintaining price integrity.

[ETH/USD Spot] has 4 price sources, which are:

stETH New oracle:

frxETH New oracle:

weETH New oracle:

ezETH New oracle:

WBTC New oracle:

CVX oracle:

[ ]*[]

[] * [ETH/USD Spot ]

[] *[ ETH/USD Spot ]

[] * [ETH/USD Spot ]

[* [ETH/USD Spot ]

[] * []

[] * [ETH/USD Spot ]

[] * [ETH/USD Spot ]

[] * [] * [ETH/USD Spot ]

[] * []

[] * [ETH/USD Spot ]/weETH.getRate()

[] *[wstETH/stETH rate] * [ ]* [ETH/USD Spot ]

[] * [ETH/USD Spot ]

[] * []

[] * [ETH/USD Spot ]

[] * [ETH/USD Spot ]

[] * []

[WBTC/USDC spot price of ]

[ ]

[] * []

[]

[]

[] * [ETH/USD Spot ]

Code:​

1️⃣
https://data.chain.link/feeds/ethereum/mainnet/eth-usd
https://info.uniswap.org/#/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
https://info.uniswap.org/#/pools/0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8
https://v2.info.uniswap.org/pair/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
stETH/ETH Curve EMA
ETH/USD Chainlink TWAP
stETH/ETH Curve Spot
stETH/ETH Univ3 Spot
stETH/ETH Balancer Spot
stETH/ETH Curve2 Spot]
Curve frxETH/WETH EMA
Chainlink ETH/USD TWAP
Curve frxETH/WETH Spot
Curve frxeth Spot
Curve stETH/frxETH Spot
Curve steth Spot
RedStone weETH/ETH Twap
Chainlink ETH/USD TWAP
Uniswap V3 ETH/weETH 0.05%
Uniswap V3 wstETH/weETH 0.05%
Curve steth-ng
Curve weETH/ETH
RedStone ezETH/ETH Twap
Chainlink ETH/USD TWAP
Curve ezETH/ETH
Balancer V2 Stable
Chainlink WBTC/BTC Twap
Chainlink BTC/USD Twap
Curve TriCryptoUSDC
Uniswap V3 WBTC/USDC 0.3% Spot
Uniswap V3 WBTC/ETH 0.3% Spot
Uniswap V3 USDC/ETH 0.05% Spot
Chainlink CVX/USD Twap
Chainlink CVX/USD Spot
Curve CVX/ETH
https://github.com/AladdinDAO/aladdin-v3-contracts/pull/198