Marfusios / bitmex-client-websocket

🛠️ C# client for Bitmex websocket API
Apache License 2.0
63 stars 44 forks source link

Impossible to connect to orderBookL2_25 topic #36

Closed EAbychkov closed 3 years ago

EAbychkov commented 4 years ago
public class BookL2Top25SubscribeRequest : SubscribeRequestBase
    {
        /// <summary>
        /// Subscribe to order book from all pairs
        /// </summary>
        public BookL2Top25SubscribeRequest()
        {
            Symbol = string.Empty;
        }

        /// <summary>
        /// Subscribe to order book from selected pair ('XBTUSD', etc)
        /// </summary>
        public BookL2Top25SubscribeRequest(string pair)
        {
            Symbol = pair;
        }

        /// <summary>
        /// Order book L2 Top 25 topic
        /// </summary>
        [IgnoreDataMember]
        public override string Topic => "orderBookL2_25";

        /// <inheritdoc />
        [IgnoreDataMember]
        public override string Symbol { get; }
    }

This doesn't work, how to subscribe to a orderBookL2_25 topic? By the way, orderBookL2 works fine.

Marfusios commented 4 years ago

Hello @EAbychkov,

separate stream for orderBookL2_25 needs to be created. I've implemented it, it was a quick fix: https://github.com/Marfusios/bitmex-client-websocket/commit/2deebddf734aa0781f962ac89ff2cb1e46445735#diff-34a60a3b8558e468f3f776e1ce32719aR155

orderBook10 (top 10 level snapshot) is more complicated, maybe somebody can prepare a PR.

EAbychkov commented 4 years ago

Thanks a lot, @Marfusios, it's working...