Files
gogo2/test_symbol_conversion.py
2025-07-14 11:15:11 +03:00

50 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""
Test MEXC Symbol Conversion
Verify that USDT symbols are properly converted to USDC for MEXC execution
"""
import sys
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
from NN.exchanges.mexc_interface import MEXCInterface
def test_symbol_conversion():
"""Test the symbol conversion logic"""
print("Testing MEXC Symbol Conversion...")
print("=" * 50)
# Create MEXC interface (no need for real API keys for symbol conversion)
mexc = MEXCInterface(api_key="dummy", api_secret="dummy", test_mode=True)
# Test cases
test_symbols = [
"ETH/USDT",
"BTC/USDT",
"ETHUSDT",
"BTCUSDT",
"ETH/USDC", # Should stay as USDC
"ETHUSDC" # Should stay as USDC
]
print("Symbol Conversion Results:")
print("-" * 30)
for symbol in test_symbols:
converted = mexc._format_spot_symbol(symbol)
print(f"{symbol:12} -> {converted}")
print("\nExpected Results for MEXC Trading:")
print("- ETH/USDT should become ETHUSDC")
print("- BTC/USDT should become BTCUSDC")
print("- ETHUSDT should become ETHUSDC")
print("- BTCUSDT should become BTCUSDC")
print("- ETH/USDC should stay ETHUSDC")
print("- ETHUSDC should stay ETHUSDC")
if __name__ == "__main__":
test_symbol_conversion()