소스 검색

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")
                 return None
             
-            markets = await self.sync_client.load_markets()
+            markets = self.sync_client.load_markets()
             logger.info(f"✅ Successfully loaded {len(markets)} markets")
             return markets
         except Exception as e:

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

@@ -56,7 +56,7 @@ class MarketCommands(InfoCommandsBase):
             
             # Add volume information
             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"
             
             # Add order book information if available

+ 1 - 1
trading_bot.py

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