Commit 417a081
committed
Fix IndexError in fetch_positions for Hyperliquid when no pair specified
## Summary
Fix IndexError crash in fetch_positions() when initializing wallets on Hyperliquid exchange.
## Quick changelog
- Changed fetch_positions to pass None instead of empty list when no specific pair is requested
- Fixes compatibility with Hyperliquid CCXT implementation that expects None for all positions
## What's new?
When fetch_positions() is called without a specific pair parameter, the code was passing an empty list [] to the CCXT API.
For Hyperliquid exchange, this causes an IndexError because the exchange's implementation attempts to access symbols[0]
without checking if the list is empty.
The CCXT standard is to pass None (not an empty list) when requesting all positions. This change aligns the code with
the CCXT API convention and prevents the crash on Hyperliquid during wallet initialization.
Error that was occurring:
```
IndexError: list index out of range
at /root/freqtrade/.venv/lib/python3.11/site-packages/ccxt/hyperliquid.py:3051
market = self.market(symbols[0])
```
This change does not use AI-generated code.1 parent 262f4ff commit 417a081
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1834 | 1834 | | |
1835 | 1835 | | |
1836 | 1836 | | |
1837 | | - | |
| 1837 | + | |
1838 | 1838 | | |
1839 | | - | |
| 1839 | + | |
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
| |||
0 commit comments