Deribit: Fix sending trades to the websocket DataHandler (#1856)

* Fix sending trades to the DataHandler

Additionally set trade direction type to order.Side and set the time to UTC

* Amend the len check to make it scalable

* Fix the nit
This commit is contained in:
Bea
2025-04-08 08:01:50 +07:00
committed by GitHub
parent e470862774
commit 676b2e0367
4 changed files with 71 additions and 11 deletions

View File

@@ -0,0 +1,2 @@
{"jsonrpc":"2.0","method":"subscription","params":{"channel":"trades.BTC-PERPETUAL.agg2","data":[{"timestamp":1742627465811,"price":84295.5,"direction":"buy","index_price":84319.98,"instrument_name":"BTC-PERPETUAL","trade_seq":242126092,"amount":8430.0,"mark_price":84292.11,"tick_direction":2,"contracts":843.0,"trade_id":"356130997"}]}}
{"jsonrpc":"2.0","method":"subscription","params":{"channel":"trades.BTC-PERPETUAL.agg2","data":[{"timestamp":1742627361899,"price":84319.0,"direction":"sell","index_price":84348.37,"instrument_name":"BTC-PERPETUAL","trade_seq":242126084,"amount":580.0,"mark_price":84319.46,"tick_direction":2,"contracts":58.0,"trade_id":"356130979"}]}}