LUCIT-Systems-and-Development / unicorn-fy

A Python SDK by LUCIT to convert received raw data from crypto exchange API endpoints into well-formed python dictionaries.
https://unicorn-fy.docs.lucit.tech
MIT License
54 stars 20 forks source link

Parse ACCOUNT_UPDATE for margin type change in Futures #40

Closed yoavweber closed 2 years ago

yoavweber commented 2 years ago

Is your feature request related to a problem? Please describe.

When changing a margin mode in Futures a WebSocket event is created. Currently, the event is not fully parsed: {'stream_type': 'ACCOUNT_UPDATE', 'event_type': 'ACCOUNT_UPDATE', 'event_time': 1657383734073, 'transaction': 1657383734071, 'update_data': {'B': [{'a': 'USDT', 'wb': '2561.04467225', 'cw': '2557.83387650', 'bc': '0'}], 'P': [{'s': 'BTCUSDT', 'pa': '0', 'ep': '0.00000', 'cr': '467.59971010', 'up': '0', 'mt': 'cross', 'iw': '0', 'ps': 'BOTH', 'ma': 'USDT'}], 'm': 'MARGIN_TYPE_CHANGE'}, 'unicorn_fied': ['binance.com-coin_futures', '0.11.0']}

Describe the solution you'd like.

Parse the whole event.

Describe alternatives you've considered

No response

Additional context

I am happy to solve this issue, just need the green light from the maintainer.

yoavweber commented 2 years ago

Sorry I was using the wrong parser: binance_coin_futures_websocket instead of binance_com_futures_websocket