-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use IBEX server for real time price #1
Comments
Doing some preliminary research and I see two high-level approaches: Option 1: Update Price Server to call Ibex.What's required?
It's also worth noting that the Ibex rates API requires authorization, similar to what we're doing in the graphql-api server. The code we write in the
Option 2: Call Ibex directlyRemove Price Server entirely and update all references to call Ibex directly. The advantage of this approach is it's less code and infrastructure to maintain on our part. The downside is there are potentially many references that need to be updated to our codebase and could introduce bugs if not tested thoroughly. My thoughtsI lean towards option 1, as it isolates the changes and therefore less likely to effect the calling code (e.g api server, price-history cronjob, etc). Extracting the Ibex code to it's own library and then adding it to the downstream |
Let's go with Option #1, making changes to the My preference is to give our ibex authorization code its own library and make it reusable/scalable. |
Decouple tokens from graphql. Use Ibex client library |
@islandbitcoin Many of the currencies that we're fetching prices for are not available in the supported list of Ibex currencies.
How do you want to proceed? Considering we aren't focusing on these customer bases to start, it may be easiest just to remove them. |
I think the more long term solution would be to add IBEX as one of two feeds, and if IBEX doesn't have it, we pull from the other feed if IBEX doesnt have it. The best solution is to ask IBEX to add currencies as we go. They added JMD for me in a few days. |
Price server does not currently support a fallback as you're describing, so we'd need to make those changes, and the codebase is a bit convoluted imo, so this may be a bit more involved than it would ideally be. If Ibex is accommodating, that's certainly the easiest on our part. |
Looking into our options after our discussion this morning. To my understanding, there two types of currencies we're interested in:
For type 1, we want to be synchronized as closely as possible with our exchange (e.g Ibex), so that invoices match expected amounts. For type 2, we don't have a single source-of-truth, so we can fetch from one or more other price feeds. Looking back at the Also worth noting is fetching rates from Ibex does not guarantee parity between users. User A might generate an invoice at t0, and user B might scan the invoice a minute later (t1), so there still might be a small difference in price similar to the screenshot shown above. Looking at the ibex docs, this may be a fundamental Ibex limitation:
|
Thanks for the insight. I like the idea of using IBEX for USD->BTC and using our own average for all other rates. I think it is acceptable for users to see a small delta when paying an invoice if volatility is high. This is prob the reason why Ibex limits the invoice to 5 minutes. We still need to talk about the possibility to add contingency to the rate spread for Flash. |
@aliantjamaica FYI |
@islandbitcoin Unless you have any objections, I'll proceed with fetching USD<->BTC from Ibex, while leaving the other currencies to their existing sources |
no objections. |
Converted amount showing different in send-bitcoin-details-screen and receive screen
The text was updated successfully, but these errors were encountered: