Merge pull request #12594 from stremblayiOS/fix-hyperliquid-fetch-positions

Fix IndexError in fetch_positions for Hyperliquid when no pair specified
This commit is contained in:
Matthias
2025-12-05 20:16:48 +01:00
committed by GitHub

View File

@@ -1834,9 +1834,9 @@ class Exchange:
if self._config["dry_run"] or self.trading_mode != TradingMode.FUTURES: if self._config["dry_run"] or self.trading_mode != TradingMode.FUTURES:
return [] return []
try: try:
symbols = [] symbols = None
if pair: if pair:
symbols.append(pair) symbols = [pair]
positions: list[CcxtPosition] = self._api.fetch_positions(symbols) positions: list[CcxtPosition] = self._api.fetch_positions(symbols)
self._log_exchange_response("fetch_positions", positions) self._log_exchange_response("fetch_positions", positions)
return positions return positions