DigitalRuby / ExchangeSharp

ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
https://www.digitalruby.com
MIT License
737 stars 374 forks source link

GetTickersAsync failes for Binance #789

Closed jacobdeboer33 closed 1 year ago

jacobdeboer33 commented 1 year ago

Hi there

I'm no longer able to execute GetTickersAsync for binance. it failes with the following exception:

2022-09-22 22:18:33,742 - Exception in run: System.IO.InvalidDataException: No market symbol metadata returned or unable to find symbol metadata for AXSBIDR at ExchangeSharp.ExchangeAPI.ExchangeMarketSymbolToCurrenciesAsync(String marketSymbol) at ExchangeSharp.ExchangeAPIExtensions.ParseTickerAsync(ExchangeAPI api, JToken token, String marketSymbol, Object askKey, Object bidKey, Object lastKey, Object baseVolumeKey, Object quoteVolumeKey, Object timestampKey, TimestampType timestampType, Object baseCurrencyKey, Object quoteCurrencyKey, Object idKey) at ExchangeSharp.BinanceGroup.BinanceGroupCommon.ParseTickerAsync(String symbol, JToken token) at ExchangeSharp.BinanceGroup.BinanceGroupCommon.OnGetTickersAsync() at ExchangeSharp.ExchangeAPI.b85_0() at ExchangeSharp.CryptoUtility.<>c__DisplayClass89_0`1.<b0>d.MoveNext() --- End of stack trace from previous location --- at ExchangeSharp.MemoryCache.GetOrCreate[T](String key, Func1 notFound) at ExchangeSharp.CryptoUtility.CacheMethod[T](ICache cache, Dictionary2 methodCachePolicy, Func`1 method, Object[] arguments) at ExchangeSharp.ExchangeAPI.GetTickersAsync()

Any suggestions?

Thanks, Jacob

jacobdeboer33 commented 1 year ago

Hmmm. It seems to be working fine when I'm using a clone of the repo instead of the NuGet package. I will close the issue now.

Thanks, Jacob

vslee commented 1 year ago

A new official nuget will be released soon. For now, you can try using the prerelease nugets: https://dev.azure.com/DigitalRuby/DigitalRuby/_artifacts/feed/DigitalRuby Those are automatically kept up to date with the main branch of the repo.

NicolasDorier commented 1 year ago

Do you know when official nuget coming out?

vslee commented 1 year ago

Ok, I just released it https://github.com/DigitalRuby/ExchangeSharp/releases/tag/v1.0.3

NicolasDorier commented 1 year ago

@vslee should be reopened, doesn't work.

No market symbol metadata returned or unable to find symbol metadata for AXSBIDR
   at ExchangeSharp.ExchangeAPI.ExchangeMarketSymbolToCurrenciesAsync(String marketSymbol)
   at ExchangeSharp.ExchangeAPIExtensions.ParseTickerAsync(ExchangeAPI api, JToken token, String marketSymbol, Object askKey, Object bidKey, Object lastKey, Object baseVolumeKey, Object quoteVolumeKey, Object timestampKey, TimestampType timestampType, Object baseCurrencyKey, Object quoteCurrencyKey, Object idKey)
   at ExchangeSharp.BinanceGroup.BinanceGroupCommon.ParseTickerAsync(String symbol, JToken token)
   at ExchangeSharp.BinanceGroup.BinanceGroupCommon.OnGetTickersAsync()
   at ExchangeSharp.ExchangeAPI.<GetTickersAsync>b__85_0()
   at ExchangeSharp.CryptoUtility.<>c__DisplayClass89_0`1.<<CacheMethod>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at ExchangeSharp.MemoryCache.GetOrCreate[T](String key, Func`1 notFound)
   at ExchangeSharp.CryptoUtility.CacheMethod[T](ICache cache, Dictionary`2 methodCachePolicy, Func`1 method, Object[] arguments)
   at ExchangeSharp.ExchangeAPI.GetTickersAsync()
   at BTCPayServer.Services.Rates.ExchangeSharpRateProvider`1.GetRatesAsync(CancellationToken cancellationToken) in C:\Sources\btcpayserver\BTCPayServer.Rating\Providers\ExchangeSharpRateProvider.cs:line 28
   at BTCPayServer.Services.Rates.BackgroundFetcherRateProvider.Fetch(CancellationToken cancellationToken) in C:\Sources\btcpayserver\BTCPayServer.Rating\Providers\BackgroundFetcherRateProvider.cs:line 232
   at BTCPayServer.Services.Rates.BackgroundFetcherRateProvider.LatestFetch.GetResult() in C:\Sources\btcpayserver\BTCPayServer.Rating\Providers\BackgroundFetcherRateProvider.cs:line 72
   at BTCPayServer.Services.Rates.BackgroundFetcherRateProvider.Fetch(CancellationToken cancellationToken) in C:\Sources\btcpayserver\BTCPayServer.Rating\Providers\BackgroundFetcherRateProvider.cs:line 256
   at BTCPayServer.Services.Rates.BackgroundFetcherRateProvider.GetRatesAsync(CancellationToken cancellationToken) in C:\Sources\btcpayserver\BTCPayServer.Rating\Providers\BackgroundFetcherRateProvider.cs:line 205
dennisreimann commented 1 year ago

Can confirm, it still does not work with v1.0.3

vslee commented 1 year ago

Re-opened. We would welcome a pull request from anyone.

BZ-CO commented 1 year ago

It is the same issue as #785. Already fixed with #787. Everything seems to be fine in the master branch. I am not sure why it throws exception in the 1.0.3 nuget package.

dennisreimann commented 1 year ago

@vslee Can you double-check why this might not be included in the 1.0.3 release?

vslee commented 1 year ago

Easiest way would be if you could try the latest pre-release and see if it works. Then we can know if 1.0.3 is up to date.

The pre-releases are automatically built so there is no way those can not be up to date, unless the build fails.

dennisreimann commented 1 year ago

@vslee Where do I find that? I can only see 1.0.3 as the latest version up on NuGet. Thanks for your help!

vslee commented 1 year ago

https://dev.azure.com/DigitalRuby/DigitalRuby/_artifacts/feed/DigitalRuby

dennisreimann commented 1 year ago

Narrowed down the problem: It seems like the binance.com API which is used in ExchangeSharp does not return the BTCUSD pair, whereas e.g. binance.us does:

I tried replacing the base URL (.us instead of .com) and that works for us. So the issue in general seems more like binance.com removed that trading pair.

BZ-CO commented 1 year ago

@dennisreimann There is no USD currency on BinanceCom

BZ-CO commented 1 year ago

I think we should close this issue.