Tags: sleepingAnt/ccxt
Tags
Fix currency conversion in bitfinex2.fetchBalance I fetchBalance response might look like this: ``` {'info': [['exchange', 'BTC', 0.0028705, 0, None], ['exchange', 'ETH', 3.269e-05, 0, None], ['exchange', 'IOT', 163.32420707, 0, None]], 'BTC': {'free': None, 'used': 0.0, 'total': 0.0028705}, 'ETH': {'free': None, 'used': 0.0, 'total': 3.269e-05}, 'IOTA': {'free': None, 'used': 0.0, 'total': 163.32420707}, 'free': {'BTC': None, 'ETH': None, 'IOTA': None}, 'used': {'BTC': 0.0, 'ETH': 0.0, 'IOTA': 0.0}, 'total': {'BTC': 0.0028705, 'ETH': 3.269e-05, 'IOTA': 163.32420707}} ``` As you can see, `IOT` is not properly converted to `IOTA. Note that the code as returned from bitfinex is `IOT`, and does not have a `t` prefix. `this.currencies_by_id` looks like this: ``` 'IOTA': {'id': 'tIOT', 'code': 'IOTA'}, ``` Here, the id is prefixed with a `t`. The code in fetchBalance also checks for a prefixed `t`. Currently then, `commonCurrencyCode` is not called. [ci skip]
Cobinhood order cost should respect filled amount Imagine this order: ``` { "id": "efdd2453-f415-46d6-92f1-13dbac888565", "datetime": "2018-06-23T12:39:30.152Z", "timestamp": 1529757570152, "lastTradeTimestamp": null, "status": "canceled", "symbol": "ETH/USDT", "type": "limit", "side": "sell", "price": 469.69, "cost": 92.91219704, "amount": 0.197816, "filled": 0.10610126, "remaining": 0.09171473999999999, "trades": null, "fee": null, "info": { "id": "efdd2453-f415-46d6-92f1-13dbac888565", "trading_pair_id": "ETH-USDT", "side": "ask", "type": "limit", "price": "469.65", "size": "0.197816", "filled": "0.10610126", "state": "cancelled", "timestamp": 1529757570152, "eq_price": "469.69", "completed_at": "2018-06-23T12:39:55.65166Z", "source": "exchange" } } ``` Here, the cost calculated by ccxt is wrong, because the order is only half-filled. [ci skip]
PreviousNext