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 (EMA) 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"
Crypto: 2% difference between EMA and Spot.
Metals: 0.66% difference between EMA and Spot.
Currencies: 0.33% difference between EMA and Spot.
Thresholds for "Close Only Mode"
Crypto Assets
Asset | Threshold |
---|---|
Metals: 1.1% difference between EMA and Spot.
Currencies: 0.55% difference between EMA and Spot.
Handling High Volatility
During periods of the High Volatility Flag and Close Only, 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 as well. 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 backup oracle system to ensure protocol is functional.
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.
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.
Market | Spread Ranges |
---|---|
BTC
2.1%
ETH
2.5%
SOL
3.5%
JITO
5%
JUP
5%
PYTH
4.5%
W
5%
BONK
6.3%
Bitcoin
0%-0.04%
Ethereum
0%-0.06%
Solana
0%-0.12%