// Quick test to verify the trade validation fix const testTradeValidation = async () => { console.log('๐Ÿงช Testing trade validation with fixed amountUSD...') // Use port 9000 for Docker or 3001 for local dev const apiUrl = process.env.DOCKER_MODE ? 'http://localhost:9000' : 'http://localhost:3001' const tradeData = { symbol: 'USDCUSD', side: 'BUY', amount: 5, amountUSD: 5, // This should be passed through correctly now useRealDEX: false, // Use simulation for testing tradingPair: 'USDCUSD/USDC' } console.log('๐Ÿš€ Sending test trade to:', apiUrl) console.log('๐Ÿš€ Trade data:', tradeData) try { const response = await fetch(`${apiUrl}/api/trading/execute-dex`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(tradeData) }) const result = await response.json() console.log('๐Ÿ“Š Response status:', response.status) console.log('๐Ÿ“Š Response body:', result) if (response.ok) { console.log('โœ… Trade validation fix is working!') } else { console.log('โŒ Trade validation still has issues:', result.message) } } catch (error) { console.error('โŒ Test failed:', error) } } testTradeValidation()