Files
mev-beta/scripts/test-watch-display.sh

53 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Test script to demonstrate enhanced watch-live.sh output
# Uses actual log data to show formatted output
# Color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m'
echo "════════════════════════════════════════════════════════════"
echo "Enhanced watch-live.sh Output Demo"
echo "════════════════════════════════════════════════════════════"
echo ""
# Simulate a rejected opportunity with detailed metrics
echo -e "${YELLOW}[2025/11/02 16:19:25] 🎯 Opportunity #63 (not executable)${NC}"
echo -e "${CYAN} 🔄 Pair: WETH → USDC${NC}"
echo -e "${CYAN} 📊 Amounts: 200.000000 → 0.001179${NC}"
echo -e "${YELLOW} 💰 Estimated Profit: 0.000000 ETH${NC}"
echo -e "${RED} ⛽ Gas Cost: 0.000007 ETH (0.0070 Gwei)${NC}"
echo -e "${RED} 📉 Net After Gas: -0.000007 ETH${NC}"
echo -e "${YELLOW} 📊 Price Impact: 0.000000%${NC}"
echo -e "${RED} 📊 Profit Margin: -0.000021%${NC}"
echo -e "${YELLOW} 🎯 Confidence: 10.0%${NC}"
echo -e "${RED} ❌ Reason: negative profit after gas and slippage costs${NC}"
echo ""
# Simulate an executable opportunity (hypothetical)
echo -e "${GREEN}[2025/11/02 16:20:00] ✅ EXECUTABLE OPPORTUNITY #1${NC}"
echo -e "${CYAN} 🔄 Pair: WETH → USDC${NC}"
echo -e "${CYAN} 📊 Amounts: 1000.000000 → 2005.500000${NC}"
echo -e "${GREEN} 💰 Net Profit: 0.005500 ETH${NC}"
echo -e "${YELLOW} ⛽ Gas Cost: 0.000050 ETH${NC}"
echo -e "${GREEN} 📊 Profit Margin: 0.5500%${NC}"
echo -e "${GREEN} 📊 Price Impact: 0.000125%${NC}"
echo -e "${GREEN} 🎯 Confidence: 85.0%${NC}"
echo ""
echo "════════════════════════════════════════════════════════════"
echo "Key Improvements:"
echo " ✅ Token pair clearly displayed"
echo " ✅ Swap amounts shown"
echo " ✅ Gas cost highlighted (in ETH and Gwei)"
echo " ✅ Net profit after gas displayed"
echo " ✅ Price impact percentage"
echo " ✅ Profit margin percentage"
echo " ✅ Confidence score"
echo " ✅ Reject reason (for non-executable)"
echo "════════════════════════════════════════════════════════════"