const fs = require('fs'); console.log('🔧 Merging position sections...'); // Read the current file let content = fs.readFileSync('/app/app/automation-v2/page.js', 'utf8'); // Remove the separate positions section const positionsStart = content.indexOf(' {/* Positions */}'); const positionsEnd = content.indexOf(' )}', positionsStart + 1) + 12; // Include the closing if (positionsStart > -1 && positionsEnd > positionsStart) { content = content.slice(0, positionsStart) + content.slice(positionsEnd); console.log('✅ Removed separate positions section'); } // Find and update the position monitor section const monitorStart = content.indexOf(' {/* Position Monitor */}'); const monitorEnd = content.indexOf(' )}', monitorStart + 1) + 12; if (monitorStart > -1 && monitorEnd > monitorStart) { const newMonitorSection = ` {/* Merged Position Status & Monitor */}
{monitorData.details}
Start automation to begin trading