sonvister / Binance

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

TRXBTC symbol for 1M has negative volume #83

Open sguryev opened 6 years ago

sguryev commented 6 years ago

https://github.com/sonvister/Binance/blob/da2967a181212fda937a28ed6fcdd284f0778966/src/Binance/Market/Candlestick.cs#L134 Reprosteps: await _binanceApi.GetCandlesticksAsync("TRXBTC", CandlestickInterval.Month); Json: image

Inner exception: Candlestick: volume must not be less than 0. Parameter name: volume

StackTrace: at Binance.Candlestick..ctor(String symbol, CandlestickInterval interval, DateTime openTime, Decimal open, Decimal high, Decimal low, Decimal close, Decimal volume, DateTime closeTime, Decimal quoteAssetVolume, Int64 numberOfTrades, Decimal takerBuyBaseAssetVolume, Decimal takerBuyQuoteAssetVolume) at Binance.Serialization.CandlestickSerializer.<>c__DisplayClass14_0.b0(JToken item) at System.Linq.Enumerable.SelectIListIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Binance.BinanceApi.d26.MoveNext()

sonvister commented 6 years ago

@sguryev, thanks for reporting the exception. I have asked if the data is valid on the official API Telegram. Although, I can't imagine what a negative volume would represent if it is valid data.

sguryev commented 6 years ago

@sonvister absolutely agree with you. I'm getting a bunch of symbols for 1M using Task.WhenAll() and now have to make a tricky Task.Run() workaround in order to swallow the exception. We can point them to the specific API call and ask about this negative value though

sonvister commented 6 years ago

UPDATE: The query (https://api.binance.com/api/v1/klines?symbol=TRXBTC&interval=1M) still returns a negative volume....