bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.19k stars 679 forks source link

clientId/clientOrderId is not relayed from FTX's ORDER_INFO #861

Closed svabra closed 2 years ago

svabra commented 2 years ago

Describe the bug CryptoFeed offers ORDER_INFO channel for FTX . According to the FTX documentation, the FTX Websocket also submits the attribute clientId, which we have submitted with our order request. Here the response of the success.

{'info': {'id': '155822361070', 'clientId': '0_1655455290.2320077', 'market': 'BTC/USD', 'type': 'limit', 'side': 'buy', 'price': '12100.0', 'size': '0.0002', 'status': 'new', 'filledSize': '0.0', 'remainingSize': '0.0002', 'reduceOnly': False, 'liquidation': None, 'avgFillPrice': None, 'postOnly': True, 'ioc': False, 'createdAt': '2022-06-17T08:41:33.775826+00:00', 'future': None}, 'id': '155822361070', 'clientOrderId': '0_1655455290.2320077', 'timestamp': 1655455293775, 'datetime': '2022-06-17T08:41:33.775Z', 'lastTradeTimestamp': None, 'symbol': 'BTC/USD', 'type': 'limit', 'timeInForce': 'PO', 'postOnly': True, 'side': 'buy', 'price': 12100.0, 'stopPrice': None, 'amount': 0.0002, 'cost': 0.0, 'average': None, 'filled': 0.0, 'remaining': 0.0002, 'status': 'open', 'fee': None, 'trades': [], 'fees': []}

The channel is supposed to deliver the clientId (which was also confirmed by the REST response. see above). Below is what FTX is delivering (copy from the documentation). https://docs.ftx.com/?python#orders-2

{
  "channel": "orders",
  "data": {
    "id": 24852229,
    "clientId": null,
    "market": "XRP-PERP",
    "type": "limit",
    "side": "buy",
    "size": 42353.0,
    "price": 0.2977,
    "reduceOnly": false,
    "ioc": false,
    "postOnly": false,
    "status": "closed",
    "filledSize": 42353.0,
    "remainingSize": 0.0,
    "avgFillPrice": 0.2978,
    "createdAt": "2021-05-02T22:40:07.217963+00:00"
  },
  "type": "update"
}

But, cryptofeed omits multiple values - also the clientId. Is there a reason for not forwarding the entire message?

{
  "exchange": "FTX",
  "symbol": "BTC-USD",
  "id": "155822361070",
  "side": "buy",
  "status": "submitting",
  "type": "limit",
  "price": "12100.0",
  "amount": "0.0",
  "remaining": "0.0002",
  "account": "tkss-normalized-macd",
  "timestamp": None,
}

To Reproduce Steps to reproduce the behavior:

Expected behavior Add the clientid to the ORDER_INFO message. - or a more generic approach - append also the raw_data with the ORDER_INFO if requested with the intantiation:__init__(self, config=None, raw_data_collection=None, append_raw_data=False):

Cryptofeed Version

svabra commented 2 years ago

Pull Request submitted.