|
@@ -235,13 +235,8 @@ class HyperliquidClient:
|
|
return None
|
|
return None
|
|
|
|
|
|
def get_positions(self, symbol: Optional[str] = None) -> Optional[List[Dict[str, Any]]]:
|
|
def get_positions(self, symbol: Optional[str] = None) -> Optional[List[Dict[str, Any]]]:
|
|
- """Get current positions."""
|
|
|
|
|
|
+ """Get current positions for a symbol or all symbols."""
|
|
try:
|
|
try:
|
|
- if not self.sync_client:
|
|
|
|
- logger.error("❌ Client not initialized")
|
|
|
|
- return None
|
|
|
|
-
|
|
|
|
- # Add user parameter for Hyperliquid CCXT compatibility
|
|
|
|
params = {}
|
|
params = {}
|
|
if Config.HYPERLIQUID_WALLET_ADDRESS:
|
|
if Config.HYPERLIQUID_WALLET_ADDRESS:
|
|
wallet_address = Config.HYPERLIQUID_WALLET_ADDRESS
|
|
wallet_address = Config.HYPERLIQUID_WALLET_ADDRESS
|
|
@@ -249,7 +244,7 @@ class HyperliquidClient:
|
|
|
|
|
|
logger.debug(f"🔍 Fetching positions with params: {params}")
|
|
logger.debug(f"🔍 Fetching positions with params: {params}")
|
|
positions = self.sync_client.fetch_positions([symbol] if symbol else None, params=params)
|
|
positions = self.sync_client.fetch_positions([symbol] if symbol else None, params=params)
|
|
- logger.info(f"✅ Successfully fetched positions for {symbol or 'all symbols'}")
|
|
|
|
|
|
+ logger.debug(f"✅ Successfully fetched positions for {symbol or 'all symbols'}")
|
|
return positions
|
|
return positions
|
|
except Exception as e:
|
|
except Exception as e:
|
|
error_message = self._extract_error_message(e)
|
|
error_message = self._extract_error_message(e)
|