Drift Protocol has a number of resiliency checks around oracles. Currently, Drift only utilises Pyth as an oracle source, but has the flexiblility to update as necessary on a per market basis.
For robustness, the program checks the oracle validity. An oracle will return a price validity error if any of following conditions occur:
1. Stale pricing (latest slot update too far behind, currently: 1000 slots)
2. Confidence interval is too large (confidence if very large percent of price, currently: >25%)
3. Negative price (any price field < 0)
4. Price too volatile (TWAP/price ratio out of bounds, currently: 50%)
In the case of oracle error, the market will pause most liquidations and funding rate updates.
In the case of a large oracle and mark price divergence (currently: >10%), and the oracle price is valid, then liquidations will be paused.
Full logic for blocking/allowing liquidations:
The Clearinghouse will also pause risk-increasing trades that further increase this oracle and mark divergence. Closing a position that further breaches this divergence is also not allowed (unless the divergence has already been breached).
- improve resiliency against oracle manipulation