JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Binance.Net/
MIT License
1.02k stars 420 forks source link

SubscribeToOrderBookUpdatesAsync is not working for spot #1345

Closed C06alt1 closed 4 months ago

C06alt1 commented 4 months ago

SubscribeToOrderBookUpdatesAsync is not getting any information for spot but it does for futures

Here is a simple console app to demonstrate the problem

class Program
{
    static void Main(string[] args)
    {
        {
            var socketClient = new BinanceSocketClient();
            socketClient.SpotApi.ExchangeData.SubscribeToOrderBookUpdatesAsync("BTCUSDT", 500, data =>
            {
                Console.WriteLine("SpotApi SubscribeToOrderBookUpdatesAsync() " + data.Data.Asks.Last().Price);
            });

            socketClient.UsdFuturesApi.SubscribeToOrderBookUpdatesAsync("BTCUSDT", 500, data =>
            {
                Console.WriteLine("UsdFuturesApi SubscribeToOrderBookUpdatesAsync() " + data.Data.Asks.Last().Price);
            });
            Console.ReadLine();
        }
    }
}

You will notice only the UsdFuturesApi message will display in the console.

SubscribeToPartialOrderBookUpdatesAsync also seems to be broken for SpotApi.

JKorf commented 4 months ago

The second update, 500, is invalid for the spot subscription. If you change the spot (or both) update interval to 100 it will work

C06alt1 commented 4 months ago

Thanks Jan I probably overlooked that in the documentation. I have been using Binance.Net on futures for the last few years And am very grateful for all your efforts. Your a very skilled programmer keep up the good work.