sonvister / Binance

A .NET Standard Binance API library.
MIT License
229 stars 77 forks source link

Get24HourStatisticsAsync exception #119

Closed evo11x closed 5 years ago

evo11x commented 5 years ago

Suddenly the Get24HourStatisticsAsync function is not working and throwing this exception in BinanceApi.c Line 321 {"SymbolStatistics: price must not be less than 0.\r\nParameter name: weightedAveragePrice"}

The json data seems to there, so there is data returned and is valid.

The exception is thrown at BTTBTC and BTTUSDT symbol for which the weightedAveragePrice is -0.00000052 Also volume for BTTBTC and BTTUSDT symbol is less than 0 which also causes an exception

I don't think that an invalid value for a single symbol should fail the entire Get24HourStatisticsAsync function, maybe it needs to be changed. Binance never added a new trading pair with invalid values until now, but it seems that it can happen.

grantcolley commented 5 years ago

Any progress on this one?

khoofard commented 5 years ago

Here is what started for me today:

exception isBinanceApi.Get24HourStatisticsAsync failed to parse JSON api response: "{"symbol":"BTTUSDT","priceChange":"-0.00000090","priceChangePercent":"-0.092","weightedAvgPrice":"-0.00119061","prevClosePrice":"0.00097750","lastPrice":"0.00097660","lastQty":"268686.00000000","bidPrice":"0.00097520","bidQty":"268663.00000000","askPrice":"0.00097670","askQty":"407048.00000000","openPrice":"0.00097750","highPrice":"0.00116500","lowPrice":"0.00094500","volume":"-85492386110.09551616","quoteVolume":"101788041.84361580","openTime":1549943621556,"closeTime":1550030021556,"firstId":1402731,"lastId":1591951,"count":189221}"

Any help is very much appreciated!

sonvister commented 5 years ago

I was unable to reproduce these errors today, but made a couple of edits based on the comments.