mirror of
https://github.com/saymrwulf/alpha-arena.git
synced 2026-07-22 19:11:33 +00:00
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
40 lines
863 B
Swift
40 lines
863 B
Swift
import Foundation
|
|
|
|
/// Represents the current state of the Alpha Arena server
|
|
enum ServerStatus: String, Codable {
|
|
case running
|
|
case stopped
|
|
case starting
|
|
case stopping
|
|
case error
|
|
}
|
|
|
|
/// Server state with connection details
|
|
struct ServerState: Equatable {
|
|
var status: ServerStatus = .stopped
|
|
var url: String = "http://127.0.0.1:8000"
|
|
var host: String = "127.0.0.1"
|
|
var port: Int = 8000
|
|
var errorMessage: String?
|
|
var lastChecked: Date?
|
|
|
|
var isRunning: Bool {
|
|
status == .running
|
|
}
|
|
|
|
var displayURL: String {
|
|
"http://\(host):\(port)"
|
|
}
|
|
}
|
|
|
|
/// Health check response from the API
|
|
struct HealthResponse: Codable {
|
|
let status: String
|
|
let timestamp: String?
|
|
let version: String?
|
|
let uptime: Double?
|
|
|
|
var isHealthy: Bool {
|
|
status == "ok" || status == "healthy"
|
|
}
|
|
}
|