wisespace-io / binance-rs

Rust Library for the Binance API
Other
687 stars 305 forks source link

Update futures trade model #244

Open stefaj opened 5 months ago

stefaj commented 5 months ago

As discussed in #243 the Trade Event for the futures websocket used the spot model which is incorrect and didn't work. I adjusted the futures model to match the current json data and specified the events to use this futures endpoint.

The data looks as follows: {'stream': 'wifusdc@trade', 'data': {'e': 'trade', 'E': 1719051857284, 'T': 1719051857284, 's': 'WIFUSDC', 't': 18074627, 'p': '1.7728000', 'q': '34.8', 'X': 'MARKET', 'm': True}}

I don't know Rust best practices and followed existing code.

This undocumented futures trade endpoint can be subscribed to using symbol@trade.