-
Notifications
You must be signed in to change notification settings - Fork 161
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
Price feeder limitations #792
Comments
Looking into solving the osmosis issue first since it blocks the most. We should aggregate the "Swap Exact Amount In" Transactions (e.g. this ATOM/ROWAN tx) and then use this to build an OHCL websocket. The spot endpoint doesn't have support for volume, so we'll need to query transactions for both of these Check out this repo for updates on development of this API :^) |
About the proposal (1) We also could check on our own the number of exchanges on which a pair is listed using the providers |
@RafilxTenfen yeah but this needs to also cover providers which we haven't implemented.
We'd have to then implement the new provider as soon as possible, especially if it has high volume |
Imo this can be solved for blue chip assets in the short-term by adding osmosis support, since mexc & bitget have both been added as providers for the price feeder |
Adding @rbajollari onto this since he's working on using coingecko for # 1 🥳 |
Would be good to have at least 2 sources of exchanges... to avoid things like this again |
Agree, atm we mitigated this in #1496 by adding an override. That way the price feeders don't go down when coingecko goes down. This can probably be closed after #1470 & we open a few tickets around cleanup like this ^ |
Closing this out 🥳 |
Summary
Our price feeder has a few limitations that will affect our ability to support coins in the long term.
Problem Definition
Our price feeder is limited by :
Currently for the price feeder to vote on an exchange rate, it has to have at least three providers. This is to avoid scenarios where one provider goes down and we become dependent on another, which might malfunction or have low enough volume to be manipulated. This creates a pretty big issue in the cosmos ecosystem, because there are quite a few tokens only on one or two exchanges, such as osmosis and juno.
So, the right number of providers to require for an exchange rate is the number of providers which list that rate.
Certain APIs have stale data, such as the osmosis API we're using, which consistently returns historical data from ~6-4 minutes ago. The price feeder only uses the most recent information, so it filters out any candles that occurred before a certain amount of time, currently set to three minutes. So, this rule keeps us further from supporting coins that are only on osmosis.
So really, the right number of providers to require for an exchange rate is the number of providers which list that rate, and has an up-to-date, low-latency API available.
Proposal
We should :
Use an external data source (or sources) like coingecko to determine the amount of exchanges on which a pair is listed, and require that amount instead of the default of "3".
a. Need to decide on what to do in the case that these APIs fail; do we require 3 as the default or are we more lenient to support those currencies which only have one or two exchange rates?
Find a way to get more recent pricing data from osmosis. This would probably require us to run our own osmosis node & API instead of using imperator's.
a. Still need to look into endpoint limitations. If this data isn't accessible, how do we determine what is an acceptable time period per provider?
For Admin Use
The text was updated successfully, but these errors were encountered: