Files
mev-beta/scripts/monitor-24h-test.sh
Krypto Kajun 432bcf0819 docs: add flash loan, binding, and testing documentation
Additional documentation and testing infrastructure:

## Documentation Added
- PROFIT_ROADMAP.md - 4-week profitability roadmap
- PRODUCTION_DEPLOYMENT.md - Production deployment guide
- docs/FLASH_LOAN_DEPLOYMENT_GUIDE.md - Flash loan implementation
- docs/FLASH_LOAN_IMPLEMENTATION_SUMMARY.md - Flash loan summary
- docs/BINDING_CONSISTENCY_GUIDE.md - Contract binding guidelines
- docs/BINDING_QUICK_START.md - Quick start for bindings
- docs/COMPLETE_FORK_TESTING_GUIDE.md - Fork testing guide

## Testing Scripts Added
- scripts/generate-test-report.sh - Generate test reports
- scripts/monitor-24h-test.sh - 24-hour monitoring
- scripts/start-24h-test.sh - Start long-running tests
- scripts/stop-24h-test.sh - Stop test runs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 05:51:44 -05:00

69 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Monitor 24-hour test progress
LOG_DIR="logs/24h_test"
PID_FILE="${LOG_DIR}/mev-bot.pid"
if [ ! -f "${PID_FILE}" ]; then
echo "❌ No test running (PID file not found)"
exit 1
fi
PID=$(cat "${PID_FILE}")
if ! ps -p "${PID}" > /dev/null 2>&1; then
echo "❌ Bot not running (PID ${PID} not found)"
exit 1
fi
# Find latest log
LATEST_LOG=$(ls -t ${LOG_DIR}/test_*.log 2>/dev/null | head -1)
if [ -z "${LATEST_LOG}" ]; then
echo "❌ No log file found"
exit 1
fi
echo "📊 MEV Bot 24-Hour Test Monitor"
echo "================================"
echo "PID: ${PID}"
echo "Log: ${LATEST_LOG}"
echo "Running since: $(ps -o lstart= -p ${PID})"
echo ""
# Stats
echo "📈 Statistics:"
BLOCKS=$(grep -c "Processing.*transactions" "${LATEST_LOG}" 2>/dev/null || echo "0")
DEX=$(grep -c "DEX Transaction detected" "${LATEST_LOG}" 2>/dev/null || echo "0")
OPPS=$(grep -c "ARBITRAGE OPPORTUNITY" "${LATEST_LOG}" 2>/dev/null || echo "0")
PROFITABLE=$(grep "ARBITRAGE OPPORTUNITY" "${LATEST_LOG}" 2>/dev/null | grep -c "isExecutable:true" || echo "0")
echo " Blocks processed: ${BLOCKS}"
echo " DEX transactions: ${DEX}"
echo " Opportunities: ${OPPS}"
echo " Profitable: ${PROFITABLE}"
echo ""
# Recent activity
echo "🔍 Recent Activity (last 10 opportunities):"
grep "ARBITRAGE OPPORTUNITY" "${LATEST_LOG}" 2>/dev/null | tail -10 | while read line; do
echo " $(echo $line | grep -o 'netProfitETH:[^ ]*' || echo 'N/A')"
done
echo ""
# Cache metrics
echo "💾 Cache Metrics:"
grep "Reserve cache metrics" "${LATEST_LOG}" 2>/dev/null | tail -1 || echo " Not available yet"
echo ""
# Errors
ERRORS=$(grep -c "\[ERROR\]" "${LATEST_LOG}" 2>/dev/null || echo "0")
echo "⚠️ Errors: ${ERRORS}"
if [ "${ERRORS}" -gt "0" ]; then
echo " Recent errors:"
grep "\[ERROR\]" "${LATEST_LOG}" 2>/dev/null | tail -3 | sed 's/^/ /'
fi
echo ""
echo "📝 Live monitoring:"
echo " tail -f ${LATEST_LOG} | grep -E 'ARBITRAGE|ERROR|Reserve cache'"