Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-ticker check is robust to a single outlier #57

Open
tkporter opened this issue Jun 22, 2021 · 1 comment
Open

Cross-ticker check is robust to a single outlier #57

tkporter opened this issue Jun 22, 2021 · 1 comment

Comments

@tkporter
Copy link
Contributor

tkporter commented Jun 22, 2021

Expected Behavior

The cross-ticker check is robust to one exchange price being wildly different than the others, excluding the exchange from the price calculation.

Current Behavior

There is a "cross-ticker" check that requires the mid-price of all exchanges to be within X% of each other. Sometimes, due to unusual circumstances, an exchange could be trading at a premium/discount. We saw this with Bittrex a few weeks ago where they were having issues with their node and wouldn't allow deposits/withdrawals. This caused the price to deviate by a lot, resulting in the cross-ticker check failing.

Reason for Need: Price deviations of specific pairs by exchange (e.g. CELO/EUR on Coinbase) should not take down the whole price feed.

@tkporter
Copy link
Contributor Author

In my opinion this isn't critical but is a nice to have.

Copying discussion from Slack:

Trevor:
An interesting situation we may want to learn from for the oracles:
Bittrex is having some issues with their node (I think? I saw some msgs about it but I'm not in the loop), and it's trading at a pretty big premium as a result. Mid price of $3.45 on Bittrex compared to $3.10 on Coinbase.
The spread on CELO-EUR and CELO-USD is really big on Bittrex, so the Bittrex price data is failing that "per-ticker" check and is removed from price aggregation. However the CELO-BTC spread is (or at least was for a little) tight enough where the Bittrex price data would make it to the "cross-ticker" checks, at which point a cross-ticker check that ensures the mid price of all exchanges is within X% of each other would fail. Failing a cross-ticker check causes price reporting to not occur.
I wonder how we could do better in situations like this. We have the isOrderbookLive check that isn't sufficient (as it just checks if trading is live). Even if we had a check that hits Bittrex's status page and checks if deposits/withdrawals are working, status pages are unreliable and there are probably other reasons why trading could be happening at a premium/discount. Clearly the Bittrex price is the outlier from other exchanges though, and we'll probably see something like this again from an exchange. Maybe we should make the cross-ticker check robust to one price being an outlier, in which case it's just thrown out?

Markus:
An outlier check makes sense. The outlier could be thrown out if all the other reported prices are sufficiently close.

Tobi:
I agree

Volpe:
It feels to me that if one ticker has a huge premium/discount, oracles should then stop considering data for the while exchange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant