Oracles

Oracle Mechanisms

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 mint at the minimum price

fToken redeem at the maximum price

xToken mint at the maximum price

xToken redeem at the minimum price

Risk management: Collateralized ratio is calculated at 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: NAV is calculated based on TWAP during non-transacting period. 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] have 4 price sources, which are:

stETH oracle:

  1. [stETH/ETH Curve Spot] * [ETH/USD Spot ]

  2. [stETH/ETH Univ3 Spot] *[ ETH/USD Spot ]

  3. [stETH/ETH Balancer Spot] * [ETH/USD Spot ]

  4. [stETH/ETH Curve2 Spot] * [ETH/USD Spot ]

frxETH oracle:

  1. [Curve frxETH/WETH Spot] * [ETH/USD Spot ]

  2. [Curve frxeth Spot] * [ETH/USD Spot ]

weETH oracle:

  1. [Uniswap V3 ETH/weETH 0.05%] * [ETH/USD Spot ]/weETH.getRate()

  2. [Uniswap V3 wstETH/weETH 0.05%] *[wstETH/stETH rate] * [ Curve steth-ng]* [ETH/USD Spot ]

  3. [Curve weETH/ETH] * [ETH/USD Spot ]

ezETH oracle:

  1. [Curve ezETH/ETH] * [ETH/USD Spot ]

  2. [Balancer V2 Stable] * [ETH/USD Spot ]

WBTC oracle:

  1. [WBTC/USDC spot price of Curve TriCryptoUSDC]

CVX oracle:

  1. [Curve CVX/ETH] * [ETH/USD Spot ]

Code: https://github.com/AladdinDAO/aladdin-v3-contracts/pull/198

Oracle of F(x) 2.0

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 2%) 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:

[stETH/ETH Spot] Oracle:

[stETH/USD] Anchor Price Oracle(A backup Oracle for the price-checking Mechanism):

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 ])

Here is how the price-checking mechanism works:

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

  • threshold is an exchangeable parameter in future governance proposals, 2% in default

Conclusion:

  • Min stETH/USD Price is used while Rebalancing, Minting/Redeeming of xPOSITION, and the price difference between Anchor Price and Min Price didn't exceed threshold

  • Anchor Price is used while Rebalancing, Minting/Redeeming of xPOSITION, and the price difference between Anchor Price and Min Price exceeded threshold

  • Max stETH/USD Price is used while Redeeming fxUSD, and the price difference between Anchor Price and Max Price didn't exceed threshold

  • Anchor Price is used while Redeeming fxUSD, and the price difference between Anchor Price and Max Price exceeded threshold

Last updated

Was this helpful?