yufuquant / rust-bybit

Rust API connector for Bybit's WebSockets APIs.
MIT License
34 stars 10 forks source link

Fail to subscribe for many symbols at once #24

Open Sild opened 10 months ago

Sild commented 10 months ago

Hi, I try to subscribe for all possible symbols (about 400), and get an error

[2023-11-06T19:33:45Z ERROR bybit::ws] Error: data did not match any variant of untagged enum SpotPublicResponse
[2023-11-06T19:33:45Z DEBUG bybit::ws] Received: {"success":false,"ret_msg":"args size \u003e10","conn_id":"0a555e6f-199c-49bb-9bb8-6f8adcd8b057","op":"subscribe"}

args size \u003e10 decoded as args size > 10

It can be easily fixed by splitting the topics for batches with size=10

I'm happy to provide the MR: https://github.com/yufuquant/rust-bybit/pull/25