Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to parse result when using GetOrderBookTopsAsync #127

Open
pavlexander opened this issue Apr 5, 2020 · 1 comment
Open

unable to parse result when using GetOrderBookTopsAsync #127

pavlexander opened this issue Apr 5, 2020 · 1 comment

Comments

@pavlexander
Copy link

Using .Net Core 3.1 console app:

    static async Task Main(string[] args)
    {
        Console.WriteLine("Hello World!");

        var apikey = "<>";
        var apisecret = "<>";

        var user = new BinanceApiUser(apikey, apisecret);
        var api = new BinanceApi();

        //var sth = await api.GetOrderBookTopsAsync(); // this will fail!
        var sth2 = await api.GetOrderBookTopAsync("ETHBTC");
        var sth3 = await api.GetOrderBookAsync("ETHBTC", 10);

        Console.WriteLine("End");
        Console.ReadKey();
    }

The first line var sth = await api.GetOrderBookTopsAsync(); will crash the program with error:

Binance.BinanceApiException
HResult=0x80131500
Message=BinanceApi.GetOrderBookTopsAsync failed to parse JSON api response: "
...
Inner Exception 1:
ArgumentException: OrderBookTop ask price must be greater than the bid price. (Parameter 'Price')

error_details.txt

binance 0.2.0-beta902

@ogzkc
Copy link

ogzkc commented Jun 25, 2020

It's about the AskPrice, some symbols that which in BREAK mode comes with zero AskPrice. Then in constructor of OrderBookTop it throws that Exception because BidPrice is not zero and AskPrice is zero. I guess API v1's behavior is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants