|
@@ -257,7 +257,7 @@ class TradingEngine:
|
|
|
stop_loss_price: Optional[float] = None) -> Dict[str, Any]:
|
|
|
symbol = f"{token}/USDC:USDC"
|
|
|
token_info = await self.get_token_info(token)
|
|
|
- formatter = get_formatter(token_info)
|
|
|
+ formatter = get_formatter()
|
|
|
|
|
|
try:
|
|
|
# Validate inputs
|
|
@@ -419,7 +419,7 @@ class TradingEngine:
|
|
|
stop_loss_price: Optional[float] = None) -> Dict[str, Any]:
|
|
|
symbol = f"{token}/USDC:USDC"
|
|
|
token_info = await self.get_token_info(token)
|
|
|
- formatter = get_formatter(token_info)
|
|
|
+ formatter = get_formatter()
|
|
|
|
|
|
try:
|
|
|
if usdc_amount <= 0:
|
|
@@ -569,7 +569,7 @@ class TradingEngine:
|
|
|
if not position:
|
|
|
return {"success": False, "error": f"No open position found for {token}"}
|
|
|
|
|
|
- formatter = get_formatter() # Get formatter
|
|
|
+ formatter = get_formatter()
|
|
|
try:
|
|
|
symbol = f"{token}/USDC:USDC"
|
|
|
position_type, exit_side, contracts_to_close = self.get_position_direction(position)
|
|
@@ -672,7 +672,7 @@ class TradingEngine:
|
|
|
if not position:
|
|
|
return {"success": False, "error": f"No open position found for {token} to set stop loss."}
|
|
|
|
|
|
- formatter = get_formatter() # Get formatter
|
|
|
+ formatter = get_formatter()
|
|
|
try:
|
|
|
symbol = f"{token}/USDC:USDC"
|
|
|
position_type, exit_side, contracts = self.get_position_direction(position)
|
|
@@ -768,7 +768,7 @@ class TradingEngine:
|
|
|
if not position:
|
|
|
return {"success": False, "error": f"No open position found for {token} to set take profit."}
|
|
|
|
|
|
- formatter = get_formatter() # Get formatter
|
|
|
+ formatter = get_formatter()
|
|
|
try:
|
|
|
symbol = f"{token}/USDC:USDC"
|
|
|
position_type, exit_side, contracts = self.get_position_direction(position)
|
|
@@ -1070,7 +1070,7 @@ class TradingEngine:
|
|
|
if not self.stats:
|
|
|
return {"success": False, "error": "TradingStats not available."}
|
|
|
|
|
|
- formatter = get_formatter() # Get formatter
|
|
|
+ formatter = get_formatter()
|
|
|
trigger_order_details = self.stats.get_order_by_db_id(original_trigger_order_db_id)
|
|
|
if not trigger_order_details:
|
|
|
return {"success": False, "error": f"Original trigger order DB ID {original_trigger_order_db_id} not found."}
|