Three-Worker Architecture
The Condor Coordinator uses a three-worker architecture that separates concerns for reliability, performance, and maintainability: Each worker is an independent process with specific responsibilities.Worker 1: Predict Worker
The most critical component - must never be blocked or fail.Responsibilities
- Connect to Model Orchestrator via ModelRunner client
- Maintain synchronized list of active models
- Fetch or receive market data in real-time
- Send tick events to all models with latest data
- Request predictions from all models
- Store predictions with metadata for later scoring
Key Characteristics
Must be:- Fast (no blocking operations)
- Reliable (graceful error handling)
- Asynchronous (handle many models concurrently)
- Perform heavy computations
- Block on slow operations
- Fail due to individual model errors
Implementation Example
Data Flow
Worker 2: Score Worker
CPU-intensive worker that computes scores and rankings.Responsibilities
- Fetch predictions that are ready to score
- Retrieve realized market data for comparison
- Compute distribution-based scores
- Calculate rolling window metrics (24h, 72h, 7d)
- Update model rankings and leaderboard
- Handle score aggregation across horizons
Key Characteristics
Can be:- Slow (CPU intensive operations allowed)
- Delayed (scoring 5-10 minutes later is fine)
- Restarted (safe to stop and resume)
- Re-run (idempotent scoring)
- Doesn’t block prediction collection
- Can run on more powerful machines
- Easy to update scoring algorithms
Implementation Example
Distribution Scoring Example
Worker 3: Report Worker
FastAPI service exposing game state and metrics.Responsibilities
- Expose HTTP API for leaderboards
- Provide per-model performance metrics
- Serve aggregated statistics
- Enable frontend visualization
- Fully decentralized (no CrunchDAO storage)
Implementation Example
Entity & Repository Pattern
Clean separation between domain logic and infrastructure:Entities
Repositories
Implementation
Next Steps
Now let’s see how to run this entire stack locally for development and testing.Local Development Setup
Learn how to run the complete Condor stack locally with Docker.