Pricing Engine
Last updated
Last updated
This document outlines our operational guidelines for handling price volatility and wide confidence intervals when utilizing the reported price provided by Pyth as our primary pricing reference. These guidelines ensure accurate pricing and informed decision-making in various market conditions.
Volatility Considerations
We monitor market volatility by comparing the reported price to the exponential moving average () reported by Pyth’s oracles. If the difference between these prices exceeds a predefined threshold, the High Volatility Flag is set for the said asset. If it exceeds a greater threshold, then Close Only mode will be active restricting all interactions except liquidations, closing position, and removing liquidity.
Thresholds for "High Volatility Flag"
Pool 1 assets: ~2% difference between EMA and Spot.
Metals: 0.66% difference between EMA and Spot.
Currencies: 0.33% difference between EMA and Spot.
Pool 3, 4, 5 asset: ~5% difference between EMA and Spot.
Crypto Assets
BTC
2.1%
ETH
2.5%
SOL
3.5%
JITO
5%
JUP
5%
PYTH
4.5%
W
5%
BONK
6.3%
Handling High Volatility
During periods of the High Volatility Flag we use confidence intervals reported by Pyth to establish an acceptable price range. The reported price serves as a baseline and depending on the accounting being done, there will be a maximum price and minimum price computed by adding/subtracting the confidence interval from the reported price. The protocol in this mode will be using the more conservative of either price when it comes to evaluating the state of user’s positions or liquidity pool shares.
Wide Confidence Intervals
In situations where Pyth's confidence interval is exceptionally wide, indicating potential variance in the reported price, the protocol goes in Close Only mode. Prices reported by Pyth are considered invalid if the volatility flag is set and the value of confidence interval exceeds 1% of the reported price. To ensure functionality of the protocol during these times and consistent on-chain pricing, Flash will use proprietary backup oracle system to ensure protocol is functional.
Volatility based fee
During periods of the High Volatility Flag threshold being active, flash's margin adds a fixed fee to new position opening to protect LPs and imitate an orderbook spread that happens during volatile times. This fee is only added on opening a position and increasing size on a existing position when the High Volatility flag is active.
Bitcoin
8bps
Ethereum
11bps
Solana
15bps
Wide Confidence Intervals with Moderate Volatility
If the volatility flag is not set but the confidence interval reported by pyth is wide (>1% of reported price), we continue relying on Pyth's reported price. In such cases, the wide confidence interval itself does not necessitate corrective action.
Handling Stable Coins
For stable coins, we assess the difference between the reported price and the benchmark of $1 to flag volatility. If the difference exceeds the threshold the High Volatility flag is set and we compute the minimum price by discounting the confidence interval from the reported price while the reported price is established as maximum price. Instructions involving actions that convert nominal usd values to token amounts like swaps and removing liquidity are calculated based on the $1 benchmark.
Size Based Spread
As traders increase their trade size from $1 to $1,000,000, there will be progressively wider spreads applied to their entry and exit prices. The specific spread amounts correspond to the values detailed in the table below.
Bitcoin
0%-0.04%
Ethereum
0%-0.06%
Solana
0%-0.12%
Conclusion
These guidelines outline our approach to managing price volatility and handling wide confidence intervals in our operations. By adhering to these guidelines, we ensure accurate pricing and well-informed decisions across diverse market conditions. We will continue adapt our strategies to changing market dynamics, maintaining the reliability and effectiveness of our price management practices.
Detailed fee table which is subject to change according to risk profile of markets can be found