alpha-arena/scripts/run_web.sh
oho 774f8b3f61 Initial commit: Alpha Arena - Polymarket Autonomous Trading Harness
A comprehensive autonomous trading system for Polymarket prediction markets
featuring multi-LLM provider support, a native macOS menu bar app, and a
web-based control dashboard.

Key features:
- Multi-agent trading system (Research, Risk, Execution, Reflection agents)
- LLM provider flexibility (Anthropic, OpenAI, Google, xAI, Local models)
- Automatic provider fallback chain for resilience
- Native Swift/SwiftUI macOS menu bar application
- FastAPI web dashboard with real-time WebSocket updates
- Risk management with kill switch
- Technical indicators and market analysis
2026-01-12 23:04:58 +01:00

80 lines
2 KiB
Bash
Executable file

#!/bin/bash
# Alpha Arena - Run Web Application
# This script activates the virtual environment and starts the web server
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_DIR"
# Check if .venv exists
if [ ! -d ".venv" ]; then
echo "ERROR: Virtual environment not found."
echo "Please run ./scripts/setup.sh first"
exit 1
fi
# Activate virtual environment
source .venv/bin/activate
# Check if dependencies are installed
if ! python -c "import fastapi" 2>/dev/null; then
echo "ERROR: Dependencies not installed."
echo "Please run ./scripts/setup.sh first"
exit 1
fi
# Parse arguments
HOST="${WEB_HOST:-127.0.0.1}"
PORT="${WEB_PORT:-8000}"
RELOAD=""
while [[ $# -gt 0 ]]; do
case $1 in
--host)
HOST="$2"
shift 2
;;
--port)
PORT="$2"
shift 2
;;
--reload)
RELOAD="--reload"
shift
;;
--production)
RELOAD=""
shift
;;
-h|--help)
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo " --host HOST Bind to host (default: 127.0.0.1)"
echo " --port PORT Bind to port (default: 8000)"
echo " --reload Enable auto-reload (development)"
echo " --production Disable auto-reload"
echo " -h, --help Show this help"
exit 0
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
echo "=============================================="
echo " Alpha Arena - Master Control Web App"
echo "=============================================="
echo ""
echo "Starting server at http://${HOST}:${PORT}"
echo ""
echo "Press Ctrl+C to stop"
echo ""
# Run the web server
python -m uvicorn src.web.app:app --host "$HOST" --port "$PORT" $RELOAD