From 3fad02ef69085ba8347fed5e2d37cb421da1751e Mon Sep 17 00:00:00 2001 From: BZ-CO <30245815+BZ-CO@users.noreply.github.com> Date: Sat, 10 Jan 2026 22:38:31 +0200 Subject: [PATCH 1/3] BinanceGroupCommon: Remove redundant ExchangeMarketSymbolToGlobalMarketSymbolAsync override --- .../BinanceGroup/BinanceGroupCommon.cs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs b/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs index d1f96770..10f70a33 100644 --- a/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs +++ b/src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs @@ -74,28 +74,6 @@ protected BinanceGroupCommon() RateLimit = new RateGate(40, TimeSpan.FromSeconds(10)); } - protected virtual string[] NonThreeLetterQuoteCurrencies => new[] { "USDT", "USDC", "EURI" }; - - public override Task ExchangeMarketSymbolToGlobalMarketSymbolAsync( - string marketSymbol - ) - { - foreach (var quoteCurrency in NonThreeLetterQuoteCurrencies) - { - if (marketSymbol.EndsWith(quoteCurrency)) - { - return ExchangeMarketSymbolToGlobalMarketSymbolWithSeparatorAsync( - marketSymbol.Substring(0, marketSymbol.Length - quoteCurrency.Length) + - GlobalMarketSymbolSeparator + - quoteCurrency); - } - } - - return ExchangeMarketSymbolToGlobalMarketSymbolWithSeparatorAsync( - marketSymbol.Substring(0, marketSymbol.Length - 3) + GlobalMarketSymbolSeparator + - marketSymbol.Substring(marketSymbol.Length - 3)); - } - /// /// Get the details of all trades /// From 3b1425f5e056c5cda1075d9ef36a2ee25f02f507 Mon Sep 17 00:00:00 2001 From: BZ-CO <30245815+BZ-CO@users.noreply.github.com> Date: Sat, 10 Jan 2026 22:38:46 +0200 Subject: [PATCH 2/3] MEXC: Remove redundant ExchangeMarketSymbolToGlobalMarketSymbolAsync override --- .../API/Exchanges/MEXC/ExchangeMEXCAPI.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs b/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs index e01b7b0b..fddc8c99 100644 --- a/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs @@ -26,24 +26,7 @@ private ExchangeMEXCAPI() RateLimit = new RateGate(20, TimeSpan.FromSeconds(2)); WebSocketOrderBookType = WebSocketOrderBookType.FullBookFirstThenDeltas; } - - public override Task ExchangeMarketSymbolToGlobalMarketSymbolAsync(string marketSymbol) - { - var quoteLength = 3; - if (marketSymbol.EndsWith("USDT") || - marketSymbol.EndsWith("USDC") || - marketSymbol.EndsWith("TUSD")) - { - quoteLength = 4; - } - - var baseSymbol = marketSymbol.Substring(marketSymbol.Length - quoteLength); - - return ExchangeMarketSymbolToGlobalMarketSymbolWithSeparatorAsync( - marketSymbol.Replace(baseSymbol, "") - + GlobalMarketSymbolSeparator - + baseSymbol); - } + protected override async Task> OnGetMarketSymbolsAsync() { From 4d2a821798f4221df827dfb955065a830749572f Mon Sep 17 00:00:00 2001 From: BZ-CO <30245815+BZ-CO@users.noreply.github.com> Date: Sat, 10 Jan 2026 22:39:24 +0200 Subject: [PATCH 3/3] BitMEX: Override ExchangeMarketSymbolToGlobalMarketSymbolAsync Adds an ExchangeMarketSymbolToGlobalMarketSymbolAsync override to convert local ISO 4217-style symbols (e.g., XBT) to global market symbols (e.g., BTC). --- .../API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs b/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs index 76ce7bb1..89f30c21 100644 --- a/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs @@ -12,6 +12,7 @@ The above copyright notice and this permission notice shall be included in all c using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net; using System.Text; @@ -52,11 +53,32 @@ private ExchangeBitMEXAPI() RateLimit = new RateGate(300, TimeSpan.FromMinutes(5)); } - public override Task ExchangeMarketSymbolToGlobalMarketSymbolAsync( + public override async Task ExchangeMarketSymbolToGlobalMarketSymbolAsync( string marketSymbol ) { - throw new NotImplementedException(); + ExchangeMarket marketSymbolMetadata = await GetExchangeMarketFromCacheAsync( + marketSymbol + ); + if (marketSymbolMetadata == null) + { + throw new InvalidDataException( + $"No market symbol metadata returned or unable to find symbol metadata for {marketSymbol}" + ); + } + + if (marketSymbolMetadata.BaseCurrency == "XBT") + { + marketSymbolMetadata.BaseCurrency = "BTC"; + } + + if (marketSymbolMetadata.QuoteCurrency == "XBT") + { + marketSymbolMetadata.QuoteCurrency = "BTC"; + } + + return await ExchangeMarketSymbolToGlobalMarketSymbolWithSeparatorAsync( + marketSymbolMetadata.BaseCurrency + GlobalMarketSymbolSeparator + marketSymbolMetadata.QuoteCurrency); } public override Task GlobalMarketSymbolToExchangeMarketSymbolAsync(