ソースを参照

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 3 週間 前
コミット
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"))