|
@@ -82,7 +82,7 @@ class TradingCommands:
|
|
|
return
|
|
|
|
|
|
# Get current market price
|
|
|
- market_data = self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
+ market_data = await self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
if not market_data:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"❌ Could not fetch market data for {token}")
|
|
|
return
|
|
@@ -203,7 +203,7 @@ This will {"place a limit buy order" if limit_price else "execute a market buy o
|
|
|
return
|
|
|
|
|
|
# Get current market price
|
|
|
- market_data = self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
+ market_data = await self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
if not market_data:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"❌ Could not fetch market data for {token}")
|
|
|
return
|
|
@@ -302,7 +302,7 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
token = _normalize_token_case(context.args[0])
|
|
|
|
|
|
# Find the position
|
|
|
- position = self.trading_engine.find_position(token)
|
|
|
+ position = await self.trading_engine.find_position(token)
|
|
|
if not position:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"📭 No open position found for {token}")
|
|
|
return
|
|
@@ -313,7 +313,7 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
unrealized_pnl = float(position.get('unrealizedPnl', 0))
|
|
|
|
|
|
# Get current market price
|
|
|
- market_data = self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
+ market_data = await self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
if not market_data:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"❌ Could not fetch current price for {token}")
|
|
|
return
|
|
@@ -380,7 +380,7 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
stop_price = float(context.args[1])
|
|
|
|
|
|
# Find the position
|
|
|
- position = self.trading_engine.find_position(token)
|
|
|
+ position = await self.trading_engine.find_position(token)
|
|
|
if not position:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"📭 No open position found for {token}")
|
|
|
return
|
|
@@ -407,12 +407,12 @@ This will {"place a limit sell order" if limit_price else "execute a market sell
|
|
|
f"📊 Your {token} SHORT position:\n"
|
|
|
f"• Entry Price: {await formatter.format_price_with_symbol(entry_price, token)}\n"
|
|
|
f"• Stop Price: {await formatter.format_price_with_symbol(stop_price, token)} ❌\n\n"
|
|
|
- f"�� Try a higher price like: /sl {token} {await formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
+ f"💡 Try a higher price like: /sl {token} {await formatter.format_price(entry_price * 1.05, token)}\n"
|
|
|
))
|
|
|
return
|
|
|
|
|
|
# Get current market price
|
|
|
- market_data = self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
+ market_data = await self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
current_price = 0
|
|
|
if market_data:
|
|
|
current_price = float(market_data['ticker'].get('last', 0))
|
|
@@ -484,7 +484,7 @@ This will place a limit {exit_side} order at {await formatter.format_price_with_
|
|
|
tp_price = float(context.args[1])
|
|
|
|
|
|
# Find the position
|
|
|
- position = self.trading_engine.find_position(token)
|
|
|
+ position = await self.trading_engine.find_position(token)
|
|
|
if not position:
|
|
|
await context.bot.send_message(chat_id=chat_id, text=f"📭 No open position found for {token}")
|
|
|
return
|
|
@@ -516,7 +516,7 @@ This will place a limit {exit_side} order at {await formatter.format_price_with_
|
|
|
return
|
|
|
|
|
|
# Get current market price
|
|
|
- market_data = self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
+ market_data = await self.trading_engine.get_market_data(f"{token}/USDC:USDC")
|
|
|
current_price = 0
|
|
|
if market_data:
|
|
|
current_price = float(market_data['ticker'].get('last', 0))
|