From 6a78853fc7993fce53c62e52fe6a91373bcc2acd Mon Sep 17 00:00:00 2001 From: JKorf Date: Fri, 29 Nov 2024 21:01:53 +0100 Subject: [PATCH] Fix for orderbook creation via factory --- CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs b/CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs index 94b3329..9171c7a 100644 --- a/CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs +++ b/CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs @@ -29,18 +29,14 @@ public CoinExOrderBookFactory(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; - Spot = new OrderBookFactory( - CreateSpot, - (sharedSymbol, options) => CreateSpot(CoinExExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options)); - Futures = new OrderBookFactory( - CreateFutures, - (sharedSymbol, options) => CreateFutures(CoinExExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options)); + Spot = new OrderBookFactory(CreateSpot, Create); + Futures = new OrderBookFactory(CreateFutures, Create); } /// public ISymbolOrderBook Create(SharedSymbol symbol, Action? options = null) { - var symbolName = CoinExExchange.FormatSymbol(symbol.BaseAsset, symbol.QuoteAsset, symbol.TradingMode, symbol.DeliverTime); + var symbolName = symbol.GetSymbol(CoinExExchange.FormatSymbol); if (symbol.TradingMode == TradingMode.Spot) return CreateSpot(symbolName, options);