fix broken merge

This commit is contained in:
Dobromir Popov
2025-10-08 20:02:41 +03:00
parent a468c75c47
commit 270ba2e52b
12 changed files with 493 additions and 86 deletions

View File

@@ -236,7 +236,14 @@ class MEXCInterface(ExchangeInterface):
params = {'symbol': formatted_symbol}
response = self._send_public_request('GET', endpoint, params)
if response and isinstance(response, dict):
return response
elif response and isinstance(response, list) and len(response) > 0:
# Find the ticker for our symbol
for ticker in response:
if ticker.get('symbol') == formatted_symbol:
return ticker
else:
logger.error(f"Ticker data for {formatted_symbol} not found in response list.")
return None
@@ -296,6 +303,12 @@ class MEXCInterface(ExchangeInterface):
def place_order(self, symbol: str, side: str, order_type: str, quantity: float, price: Optional[float] = None) -> Dict[str, Any]:
"""Place a new order on MEXC."""
try:
formatted_symbol = self._format_spot_symbol(symbol)
# Validate symbol is supported
if not self.is_symbol_supported(formatted_symbol):
logger.error(f"Symbol {formatted_symbol} is not supported by MEXC")
return {}
# Round quantity to MEXC precision requirements and ensure minimum order value