|
@@ -25,12 +25,19 @@ class MarketCommands(InfoCommandsBase):
|
|
# Get token from command arguments or use default
|
|
# Get token from command arguments or use default
|
|
token = context.args[0].upper() if context.args else Config.DEFAULT_TRADING_TOKEN
|
|
token = context.args[0].upper() if context.args else Config.DEFAULT_TRADING_TOKEN
|
|
|
|
|
|
|
|
+ # Construct the full market symbol
|
|
|
|
+ symbol = f"{token}/USDC:USDC"
|
|
|
|
+
|
|
# Get market data
|
|
# Get market data
|
|
- market_data = await self.trading_engine.get_market_data(token)
|
|
|
|
|
|
+ market_data = await self.trading_engine.get_market_data(symbol)
|
|
if not market_data:
|
|
if not market_data:
|
|
- await self._reply(update, f"❌ Could not get market data for {token}")
|
|
|
|
|
|
+ await self._reply(update, f"❌ Could not get market data for {symbol}. Check if the symbol is correct.")
|
|
return
|
|
return
|
|
|
|
|
|
|
|
+ # Get all markets to find leverage info
|
|
|
|
+ all_markets = self.trading_engine.client.get_markets()
|
|
|
|
+ market_info = all_markets.get(symbol) if all_markets else None
|
|
|
|
+
|
|
# Format the message
|
|
# Format the message
|
|
message = f"📊 <b>Market Information for {token}</b>\n\n"
|
|
message = f"📊 <b>Market Information for {token}</b>\n\n"
|
|
|
|
|
|
@@ -41,6 +48,12 @@ class MarketCommands(InfoCommandsBase):
|
|
message += f"24h Low: {self.formatter.format_price_with_symbol(market_data.get('low', 0))}\n"
|
|
message += f"24h Low: {self.formatter.format_price_with_symbol(market_data.get('low', 0))}\n"
|
|
message += f"24h Change: {market_data.get('change', 0):.2f}%\n"
|
|
message += f"24h Change: {market_data.get('change', 0):.2f}%\n"
|
|
|
|
|
|
|
|
+ # Add leverage information if available
|
|
|
|
+ if market_info:
|
|
|
|
+ max_leverage = market_info.get('limits', {}).get('leverage', {}).get('max', 'N/A')
|
|
|
|
+ if max_leverage != 'N/A':
|
|
|
|
+ message += f"Leverage: Up to {max_leverage}x\n"
|
|
|
|
+
|
|
# 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))}\n"
|