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 dd37289 commit b98515b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Kraken.Net/SymbolOrderBooks/KrakenOrderBookFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ public KrakenOrderBookFactory(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;

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

/// <inheritdoc />
Expand All @@ -40,7 +36,7 @@ public ISymbolOrderBook Create(SharedSymbol symbol, Action<KrakenOrderBookOption
if (symbol.TradingMode == TradingMode.Spot)
return CreateSpot(symbol.BaseAsset + "/" + symbol.QuoteAsset, options);

var symbolName = KrakenExchange.FormatSymbol(symbol.BaseAsset, symbol.QuoteAsset, symbol.TradingMode, symbol.DeliverTime);
var symbolName = symbol.GetSymbol(KrakenExchange.FormatSymbol);
return CreateFutures(symbolName, options);
}

Expand Down

0 comments on commit b98515b

Please sign in to comment.