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 94756db commit b8ac858
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Binance.Net/SymbolOrderBooks/BinanceOrderBookFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ public BinanceOrderBookFactory(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;

Spot = new OrderBookFactory<BinanceOrderBookOptions>(
CreateSpot,
(sharedSymbol, options) => CreateSpot(BinanceExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options));
UsdFutures = new OrderBookFactory<BinanceOrderBookOptions>(
CreateUsdtFutures,
(sharedSymbol, options) => CreateUsdtFutures(BinanceExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options));
CoinFutures = new OrderBookFactory<BinanceOrderBookOptions>(
CreateCoinFutures,
(sharedSymbol, options) => CreateCoinFutures(BinanceExchange.FormatSymbol(sharedSymbol.BaseAsset, sharedSymbol.QuoteAsset, sharedSymbol.TradingMode, sharedSymbol.DeliverTime), options));
Spot = new OrderBookFactory<BinanceOrderBookOptions>(CreateSpot, Create);
UsdFutures = new OrderBookFactory<BinanceOrderBookOptions>(CreateUsdtFutures, Create);
CoinFutures = new OrderBookFactory<BinanceOrderBookOptions>(CreateCoinFutures, Create);
}

/// <inheritdoc />
Expand All @@ -43,7 +37,7 @@ public BinanceOrderBookFactory(IServiceProvider serviceProvider)
/// <inheritdoc />
public ISymbolOrderBook Create(SharedSymbol symbol, Action<BinanceOrderBookOptions>? options = null)
{
var symbolName = BinanceExchange.FormatSymbol(symbol.BaseAsset, symbol.QuoteAsset, symbol.TradingMode, symbol.DeliverTime);
var symbolName = symbol.GetSymbol(BinanceExchange.FormatSymbol);
if (symbol.TradingMode == TradingMode.Spot)
return CreateSpot(symbolName, options);
if (symbol.TradingMode.IsLinear())
Expand Down

0 comments on commit b8ac858

Please sign in to comment.