5min

Oracles

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.

Validity Checks

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.

Liquidation Protection

In the case of a large oracle and mark price divergence (currently: >10%), and the oracle price is valid, then liquidations will be paused.

large oracle mark divergence
large oracle mark divergence

Full logic for blocking/allowing liquidations:

liquidation allow check (<- yes, no ->)
liquidation allow check (<- yes, no ->)

Price Manipulation Prevention

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

๏ปฟ

Future Work

  • improve resiliency against oracle manipulation

๏ปฟ

๏ปฟ

๏ปฟ

๏ปฟ

Updated 03 Mar 2022
Did this page help you?
Yes
No