ccxt: HitBTC Order creation Failed

Version: ccxt==1.18.188 Language: Python

I create an order with the following parameters:

side = buy price = 3448.59 symbol = BTC/TUSD amount = 52.7222

self.exchange.create_order(symbol, ord_type, side, amount, price=price)

The error is: ccxt.base.errors.InvalidOrder: hitbtc order was rejected by the exchange {“id”:“1548911740564”,“info”:{“orderId”:“N/A”,“latestOrderId”:“N/A”,“clientOrderId”:“1548911740564”,“orderStatus”:“rejected”,“participateDoNotInitiate”:false,“userId”:“user_3178015”,“symbol”:“BTCTUSD”,“side”:“buy”,“price”:“3448.59”,“quantity”:527222,“type”:“limit”,“timeInForce”:“GTC”,“lastQuantity”:0,“lastPrice”:“”,“leavesQuantity”:0,“cumQuantity”:0,“averagePrice”:“0”,“created”:1548911740689,“execReportType”:“rejected”,“orderRejectReason”:“orderExceedsLimit”},“timestamp”:null,“datetime”:null,“lastTradeTimestamp”:null,“status”:“rejected”,“symbol”:“BTC/TUSD”,“type”:“limit”,“side”:“buy”,“price”:3448.59,“cost”:181817.251698,“amount”:52.7222,“filled”:52.7222,“remaining”:0.0,“fee”:{“cost”:null,“currency”:“TUSD”,“rate”:null}}

As can be been that the quanity is being sent as 52722 instead of 52.722. I am assuming that it’s dividing/multiplying by the lots? If so, the new version of HitBTC API docs doesn’t mention this.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I will find a workaround for the thing I want to do.

That’s easy, for example (just to demonstrate it, you should override the actual mapping how you want for your needs):

import ccxt
exchange = ccxt.hitbtc2({
    'commonCurrencies': {
        'BCH': 'OLD BCH',  # rename BCH to OLD BCH
        'BCHABC': 'NEW BCH',  # rename BCHABC to NEW BCH
    },
})
# all BCH pairs will now be "OLD BCH/USDT", "OLD BCH/ETH'
# all BCHABC pairs will now be "NEW BCH/USDT", ...
# all BCH SV pairs remain as "BSV/USDT"...

You are awesome for taking the time and helping!

So if I understand correctly, we cannot reference the BCH/USDT market in hitbtc without passing custom args param because ccxt will always convert BCHABC to BCH.

HitBTC has BCH/USDT for historical reasons – the rest of the world, including CoinMarketCap and others have by now migrated to BCH ABC, so everybody now calls the new BCH ABC simply BCH.

Compare volumes here:

So, nobody really trades BCH/USDT anymore. This is a HitBTC-specific issue, and you might want to add a few overrides to the constructor to overcome this, we may add a workaround to not overwrite it, but it’s pretty much useless at this point.

Use the search to avoid duplicates ) This has been answered already:

It did solve it for me. Along with that I also noticed that some symbols like BCCHTUSD are missing from the v1 AP in ccxt but available in v2.

Thanks a lot for the help.