Skip to content

Commit

Permalink
Fix for orderbook creation via factory
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Nov 29, 2024
1 parent c674ffb commit 6a78853
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions CoinEx.Net/SymbolOrderBooks/CoinExOrderBookFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ public CoinExOrderBookFactory(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;

Spot = new OrderBookFactory<CoinExOrderBookOptions>(
CreateSpot,
(sharedSymbol, options) => CreateSpot(CoinExExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options));
Futures = new OrderBookFactory<CoinExOrderBookOptions>(
CreateFutures,
(sharedSymbol, options) => CreateFutures(CoinExExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options));
Spot = new OrderBookFactory<CoinExOrderBookOptions>(CreateSpot, Create);
Futures = new OrderBookFactory<CoinExOrderBookOptions>(CreateFutures, Create);
}

/// <inheritdoc />
public ISymbolOrderBook Create(SharedSymbol symbol, Action<CoinExOrderBookOptions>? 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);

Expand Down

0 comments on commit 6a78853

Please sign in to comment.