question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bitmex exchange metadata and use of currency pairs is inconsistent

See original GitHub issue

If 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 of XBT.

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:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jakubkalickicommented, Feb 28, 2019

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.

1reaction
jakubkalickicommented, Feb 24, 2019

Ok, i’m starting then 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found