Closed oliver-zehentleitner closed 3 years ago
@giahung24 From which exchange did you receive that data?
@giahung24 From which exchange did you receive that data?
I stream from binance.com (spot/margin) In their API Document, they said:
If the order is an OCO, an event will be displayed named
ListStatus
in addition to theexecutionReport
event.
could you post me the original raw data JSON string like:
data = '{"stream":"btcusdt@trade","data":{"e":"trade","E":1592591955766,"s":"BTCUSDT","t":343719861,"p":"9302.00000000","q":"0.00101900","b":2517144287,"a":2517144235,"T":1592591955765,"m":false,"M":true}}'
thx!
These are examples of raw data I get from binance_websocket_api_manager.pop_stream_data_from_stream_buffer()
when the KeyError exception occurs:
{"e":"listStatus","E":1606946194410,"s":"ETHUSDT","g":10717037,"c":"OCO","l":"ALL_DONE","L":"ALL_DONE","r":"NONE","C":"i8B7NXuB37QkJ2Vy8f5KHh","T":1606946194409,"O":[{"s":"ETHUSDT","i":2175939815,"c":"electron_648187c31bda49b6a2e81d23ae0"},{"s":"ETHUSDT","i":2175939816,"c":"84wruoWCZdkBUqbqlKfpv6"}]}
{"e":"listStatus","E":1606946303696,"s":"ETHUSDT","g":10717129,"c":"OCO","l":"EXEC_STARTED","L":"EXECUTING","r":"NONE","C":"xbLYz3UmLud2uIYDTqa9Qx","T":1606946303694,"O":[{"s":"ETHUSDT","i":2175947289,"c":"electron_86b14903e6f047bc9869e85e3d2"},{"s":"ETHUSDT","i":2175947290,"c":"qhL7WPy7sENJOhvB6lfoCu"}]}
This is the converted result:
result: {'stream_type': 'ethusdt@listStatus', 'event_type': 'listStatus', 'event_time': 1606946194410, 'symbol': 'ETHUSDT', 'order_list_id': 10717037, 'contingency_type': 'OCO', 'list_status_type': 'ALL_DONE', 'list_order_status': 'ALL_DONE', 'list_reject_reason': 'NONE', 'list_client_order_id': 'i8B7NXuB37QkJ2Vy8f5KHh', 'transaction_time': 1606946194409, 'objects': [{'symbol': 'ETHUSDT', 'order_id': 2175939815, 'client_order_id': 'electron_648187c31bda49b6a2e81d23ae0'}, {'symbol': 'ETHUSDT', 'order_id': 2175939816, 'client_order_id': '84wruoWCZdkBUqbqlKfpv6'}], 'unicorn_fied': ['binance.com', '0.6.0.dev']}
If you think thats fine too, I can prepare a release!
Hi, I think that's good! Glad to have quick reaction from you.
Its released: https://pypi.org/project/unicorn-fy/
Hello, Sorry for reopening the issue. I have the same error today when listening on UserData Stream. I have verified the version of unicorn-fy, it's 0.6.0.
[Update] I have identified the response that causes the error.
Can you add support for this ? Thanks in advance for your help!
_Originally posted by @giahung24 in https://github.com/oliver-zehentleitner/unicorn_fy/issues/6#issuecomment-735872583_