XChange icon indicating copy to clipboard operation
XChange copied to clipboard

[FTX] getOrder(String orderIds) method doesnt return filledSize

Open elkceo opened this issue 3 years ago • 2 comments

Right now the method ftx.getTradeService.getOrder(orderId) shows you something like that : LimitOrder [limitPrice=null, Order [type=BID, originalAmount=18.0, cumulativeAmount=18.0, averagePrice=1.090025, fee=null, instrument=XRP/USDT, id=8004102994, timestamp=Fri Sep 17 10:15:28 GET 2021, status=CLOSED, flags=[null, IOC], userReference=null]]

It looks like the order was for 18.0 XRP in that case but it is not and I see in logs Ftx return us:

{"success":true,"result":{"id":8004102994,"clientId":null,"market":"XRP/USDT","type":"market","side":"buy","price":null,"size":18.0,"status":"closed","filledSize":12.0,"remainingSize":0.0,"reduceOnly":false,"liquidation":false,"avgFillPrice":1.090025,"postOnly":false,"ioc":true,"createdAt":"2021-09-17T06:15:28.095228+00:00","future":null}}

Okay, so I hope somebody can add filledSize to Order class but right now I need to get it so I found method getFtxOrderStatus(String subaccount, String orderId) and got filledSize but may anybody tell me what I have to do in case if I am not using subaccount?

elkceo avatar Sep 17 '21 07:09 elkceo

Okay if you need to get filledSize you can use `FtxResponse<FtxOrderDto> ftxResponse = new FtxTradeServiceRaw(ftx).getFtxOrderStatus(ftx.getExchangeSpecification().getUserName(), "orderId");

    ftxResponse.getResult().getFilledSize();`

elkceo avatar Sep 17 '21 07:09 elkceo

https://github.com/knowm/XChange/pull/4442 seems to fix this

hanc1208 avatar Mar 17 '22 16:03 hanc1208