CRITICAL FIX: Resolve trade validation amountUSD passing issue

- Fixed execute-dex API to extract and forward amountUSD parameter from request body
- Updated AIAnalysisPanel to pass amountUSD in executeTrade function call
- Fixed port references in validation and execute-dex APIs to use current dev server port
- Resolves issue where amountUSD was undefined in validation causing incorrect balance calculations
- Added comprehensive logging for debugging trade data flow
- Tested successfully: 5 USD trade now validates correctly instead of requiring 832.5 USD
This commit is contained in:
mindesbunister
2025-07-16 16:20:28 +02:00
parent b7e4801e45
commit ffa3c5c8e1
2 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ export async function POST(request) {
// Fetch real wallet balance from the wallet API
let walletBalance
try {
const walletResponse = await fetch('http://localhost:3002/api/wallet/balance')
const walletResponse = await fetch('http://localhost:3001/api/wallet/balance')
const walletData = await walletResponse.json()
if (walletData.success && walletData.wallet) {