瀏覽代碼

Refactor market data retrieval in HyperliquidClient to remove unnecessary await, improving performance. Update volume formatting in MarketCommands to include token information for enhanced clarity in market data responses.

Carles Sentis 4 天之前
父節點
當前提交
da9d0bc7d3
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/clients/hyperliquid_client.py
  2. 1 1
      src/commands/info/market.py
  3. 1 1
      trading_bot.py

+ 1 - 1
src/clients/hyperliquid_client.py

@@ -440,7 +440,7 @@ class HyperliquidClient:
                 logger.error("❌ Client not initialized")
                 logger.error("❌ Client not initialized")
                 return None
                 return None
             
             
-            markets = await self.sync_client.load_markets()
+            markets = self.sync_client.load_markets()
             logger.info(f"✅ Successfully loaded {len(markets)} markets")
             logger.info(f"✅ Successfully loaded {len(markets)} markets")
             return markets
             return markets
         except Exception as e:
         except Exception as e:

+ 1 - 1
src/commands/info/market.py

@@ -56,7 +56,7 @@ class MarketCommands(InfoCommandsBase):
             
             
             # Add volume information
             # Add volume information
             message += f"\n📈 <b>Volume Information:</b>\n"
             message += f"\n📈 <b>Volume Information:</b>\n"
-            message += f"24h Volume: {self.formatter.format_amount(market_data.get('volume', 0))}\n"
+            message += f"24h Volume: {self.formatter.format_amount(market_data.get('volume', 0), token)}\n"
             message += f"24h Turnover: {self.formatter.format_price_with_symbol(market_data.get('turnover', 0))}\n"
             message += f"24h Turnover: {self.formatter.format_price_with_symbol(market_data.get('turnover', 0))}\n"
             
             
             # Add order book information if available
             # Add order book information if available

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 from pathlib import Path
 
 
 # Bot version
 # Bot version
-BOT_VERSION = "2.4.223"
+BOT_VERSION = "2.4.224"
 
 
 # Add src directory to Python path
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))
 sys.path.insert(0, str(Path(__file__).parent / "src"))