-
Notifications
You must be signed in to change notification settings - Fork 45
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
Implement aliases for assets on specific exchanges #140
Comments
Note that a mBTC in Pionex is 1/1000 of a BTC, not a Satoshi, and there is a similar "coin" for ETH called mETH. |
#146 helped pave the way for this one, but we aren't quite there yet. |
I'm wondering about how to implement this. I think the best way is to implement a fake exchange that reports the aliases as markets then let the djikstra algo do its thing. I'm wondering whether the fake exchange should take overrides in the form of a config file or csv file. They could also be declared in the ini file under the CCXT pair converter header. The overrides would be a market (e.g. MBTC/BTC) and a locked price (e.g. 0.0001). Known aliases would be added in of course, but this would allow users to add in aliases without having to commit a PR. I can't see a way to dynamically build these. They will have to be hardwired somewhere. |
Let me ask a few of questions that will help brainstorm this:
I'm not sure I understand the fake exchange concept: where would it be defined and would it need its own plugin? |
We will need to implement ([original_asset], [aliased_asset], [factor], [exchange(optional)]) in order to avoid conflicts. I think we will have about a 50/50 split of aliases that need to be universal (for all exchanges) like LUNA -> LUNC. Others, for data security, should be limited to a particular exchange, like mBTC -> BTC * 0.0001 on Pionex. I don't think there is a conflicting ISO for mBTC right now, but you never know with crypto.
Some will need to be universal, others exchange-specific
I haven't been able to find one anywhere. Different exchanges will have different policies. CCXT has aliases built into its classes, but if we use a different exchange to price an asset the aliases won't match up. For instance, the Pionex API is not implemented by CCXT, yet, so we will need to use another exchange to price assets. mBTC doesn't exist on other exchanges so we will need to build a thin fake Pionex exchange that only has aliases that link up to other exchanges. So the list will need to be compiled and maintained by us or the user. We can, of course, create a base and users can then override it in a pinch until we get a PR through. Thinking on this more, we almost need the ability to manually define edges in the graph universally for all exchanges and another option to define the edge for a specific exchange. |
That makes sense.
Yes, I think that's exactly it. I don't think we need fake exchanges, we just need the ability to add markets (graph edges) to existing exchanges. Also I agree that we can define a base and the user can extend it if they need to (probably via the config file). |
Yeah, the config file is the best route for overrides. And the base file is a csv? or hard code it into the I'll build this into the |
Ok to separate out the MappedGraph class. I think the base can be hardcoded somewhere in the codebase. The reason I wouldn't use a CSV file is that it invites the idea that it can be modified by the end user. |
Ok, I was thinking you might say that. I should be able to get something out soon then. FYI: I did get a part-time programming job with the potential to go full-time, so I might not be as available as I have been. |
Congrats, happy for you! |
@kiates Is the ticker symbol reported as "MBTC" (all caps) or "mBTC" (lower case m)? |
I'm closing this for now since it seems like it has been resolved. If anyone has further issues with aliases, let's open another issue on that specifically. |
Some exchanges use ISO tickers for crypto assets. For example, Kraken (and Bitmex) uses XBT for BTC in some places. More details on XBT vs BTC
Other exchanges use 'micro' tickers for certain assets to denote fractions of a crypto asset. For example, Pionex uses mBTC to refer to 0.001 BTC.
In order to price these appropriately, we need to implement an alias system that will create a vector between the appropriate asset the alias represents and have a locked
spot_price
of 1 if they are a true alias or a fraction if they represent a micro asset. These will then be added to the Djikstra graph with 0 weight.This helps address #133 and issues that came up with #114
The text was updated successfully, but these errors were encountered: