Description:
When using the IFuturesOrderRestClient.GetPositionsAsync shared interface for Bybit, the request fails with an ArgumentError if no Symbol is provided, even if valid Bybit V5 parameters like settleCoin or category are passed via ExchangeParameters.
The internal validation logic specifically checks for an ExchangeParameter named "SettleAsset":
C#
var symbol = request.Symbol?.GetSymbol(FormatSymbol);
if (symbol == null && ExchangeParameters.GetValue<string?>(request.ExchangeParameters, Exchange, "SettleAsset") == null)
return new ExchangeWebResult<SharedPosition[]>(Exchange, ArgumentError.Invalid("SettleAsset", "Either the Symbol request parameter or the SettleAsset exchange parameter is required"));
The Issues:
Inconsistent Naming: The Bybit V5 API documentation explicitly states that settleCoin is used. However, passing settleCoin into ExchangeParameters fails the shared API's validation because the wrapper explicitly looks for the hardcoded string "SettleAsset".
Hidden Requirement: Since category is derived from TradingMode internally, the user has to guess that "SettleAsset" (and not settleCoin) needs to be supplied when querying all positions for a specific margin asset.
Suggested Improvement:
Map settleCoin from the official API parameters or accept both "settleCoin" and "SettleAsset" in the ExchangeParameters validation.
Document these mandatory wrapper-specific keys in the Shared API documentation/XML comments.
Description:
When using the IFuturesOrderRestClient.GetPositionsAsync shared interface for Bybit, the request fails with an ArgumentError if no Symbol is provided, even if valid Bybit V5 parameters like settleCoin or category are passed via ExchangeParameters.
The internal validation logic specifically checks for an ExchangeParameter named "SettleAsset":
C#
var symbol = request.Symbol?.GetSymbol(FormatSymbol);
if (symbol == null && ExchangeParameters.GetValue<string?>(request.ExchangeParameters, Exchange, "SettleAsset") == null)
return new ExchangeWebResult<SharedPosition[]>(Exchange, ArgumentError.Invalid("SettleAsset", "Either the Symbol request parameter or the SettleAsset exchange parameter is required"));
The Issues:
Inconsistent Naming: The Bybit V5 API documentation explicitly states that settleCoin is used. However, passing settleCoin into ExchangeParameters fails the shared API's validation because the wrapper explicitly looks for the hardcoded string "SettleAsset".
Hidden Requirement: Since category is derived from TradingMode internally, the user has to guess that "SettleAsset" (and not settleCoin) needs to be supplied when querying all positions for a specific margin asset.
Suggested Improvement:
Map settleCoin from the official API parameters or accept both "settleCoin" and "SettleAsset" in the ExchangeParameters validation.
Document these mandatory wrapper-specific keys in the Shared API documentation/XML comments.