Skip to content

Commit

Permalink
Added mapping of XBT to BTC for websocket SharedSymbol formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Feb 12, 2025
1 parent d33615c commit 79c2a43
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Kraken.Net/Clients/SpotApi/KrakenSocketClientSpotApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ internal KrakenSocketClientSpotApi(ILogger logger, KrakenSocketOptions options)
protected override IMessageSerializer CreateSerializer() => new SystemTextJsonMessageSerializer();

/// <inheritdoc />
public override string FormatSymbol(string baseAsset, string quoteAsset, TradingMode tradingMode, DateTime? deliverTime = null) => $"{baseAsset.ToUpperInvariant()}/{quoteAsset.ToUpperInvariant()}";
public override string FormatSymbol(string baseAsset, string quoteAsset, TradingMode tradingMode, DateTime? deliverTime = null)
{
if (baseAsset == "XBT")
baseAsset = "BTC";

if (quoteAsset == "XBT")
quoteAsset = "BTC";

return $"{baseAsset.ToUpperInvariant()}/{quoteAsset.ToUpperInvariant()}";
}

/// <inheritdoc />
public IKrakenSocketClientSpotApiShared SharedClient => this;
Expand Down

0 comments on commit 79c2a43

Please sign in to comment.