Bitmex exchange metadata and use of currency pairs is inconsistent
See original GitHub issueIf I do the following:
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BitmexExchange.class.getName());
System.out.println(exchange.getExchangeMetaData().getCurrencyPairs().keySet());
I get:
[BTC/BTC, EOS/BTC, BCH/BTC, ADA/BTC, ETH/USD, ZEC/BTC, TRX/BTC, XLM/BTC, LTC/BTC, \
XRP/BTC, BTC/USD, ETH/BTC, DASH/BTC, XMR/BTC, ETC/BTC]
There a a few problems here
- Several of these pairs aren’t actually supported by Bitmex (looks like
bitmex.json
is just a copy & paste. I can fix that easily) BTC/BTC
?- The fact that
BTC
is used instead ofXBT
.
This last bit is interesting. The code in org.knowm.xchange.bitmex.BitmexAdapters.adaptToExchangeMetaData
seems to do this deliberately, but…
System.out.println(exchange.getMarketDataService().getTicker(CurrencyPair.BTC_USD));
… returns null, whereas…
System.out.println(exchange.getMarketDataService().getTicker(new CurrencyPair("XBT", "USD")));
… works (as I would expect, to be honest!)
How should this work? Should Bitmex accept XBT as one might expect (in which case it’s the exchange metadata implementation that’s wrong), or should it translate BTC to XBT internally (in which case the first of those two examples should work, but not the second)?
My inclination is to remove all the cleverness in org.knowm.xchange.bitmex.BitmexAdapters.adaptToExchangeMetaData
and make it use Bitmex-native currency codes throughout.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Your Step-By-Step Guide to Trading FX Swaps on BitMEX
Read our step-by-step guide for the 101 on how to trade perpetual FX swaps on our crypto derivatives trading platform.
Read more >Terms of Service for Crypto Trading on our Platform - BitMEX
It's a big read, but if you're after the BitMEX Terms of Service, stop now. They're here. Check out all the policies for...
Read more >Postmortem: Downtime, 21 September 2022 - BitMEX Blog
This caused an inconsistent state in the underlying ... At BitMEX, we use Cloudflare to protect our system from DDOS attempts, ...
Read more >Perpetual Contracts Guide - BitMEX
An inverse contract is worth a fixed amount of the quote currency. ... lower the next Funding Rate to levels consistent with where...
Read more >Trading on BitMEX
BitMEX handles cryptocurrency. BitMEX does not handle fiat currency. BitMEX allows trading with a high amount of leverage. There are 5 main navigation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Second issue is solved, now BitmexMarketDataService is consistent with other services. I have also added few integration tests. Probably tomorrow i will take care of meta data.
Ok, i’m starting then 😃