gateio / gateapi-python

247 stars 92 forks source link

Fill_price = Filled_total on order return ? #89

Closed spc789 closed 2 years ago

spc789 commented 2 years ago

I did some tests with gate_api and it seems that when placing on order, in the returned data fill_price is always the same as filled_total. While testing for example with this, I got the return below : (same thing with all orders I tried)

order = gate_api.Order(amount=str(quoteAmount), price=orderprice, side='buy', currency_pair='TRX_USDT', time_in_force='ioc') limitBuyOrderData = gateioClient.create_order(order) pprint (limitBuyOrderData)

{'account': 'spot', 'amount': '15', 'auto_borrow': None, 'auto_repay': None, 'create_time': '1639610602', 'create_time_ms': 1639610602210, 'currency_pair': 'TRX_USDT', 'fee': '0.03', 'fee_currency': 'TRX', 'fill_price': '1.3107', 'filled_total': '1.3107', 'gt_discount': False, 'gt_fee': '0', 'iceberg': '0', 'id': '104117394085', 'left': '0', 'point_fee': '0', 'price': '0.08743', 'rebated_fee': '0', 'rebated_fee_currency': 'USDT', 'side': 'buy', 'status': 'closed', 'text': 'apiv4', 'time_in_force': 'ioc', 'type': 'limit', 'update_time': '1639610602', 'update_time_ms': 1639610602210}

revilwang commented 2 years ago

If you read the model doc, you'll find fill_price is deprecated in favor of filled_total. The former is reserved for compatibility's sake.

price is the filled price. filled_total is the quote currency filled.

spc789 commented 2 years ago

Thx for your quick answer. It would indeed have helped if I read the docs