Skip to main content

Implementation Guide

This example demonstrates a production-ready Crunch implementation, with an the internal name of “Condor”. It is a financial prediction competition where participants predict asset price distributions over various time horizons. This example showcases a more advanced, real-world architecture featuring:
  • Asynchronous worker architecture (Predict, Score, Report)
  • Distribution-based predictions and scoring
  • Production-grade infrastructure with PostgreSQL
  • Complete local development environment with Docker

What You’ll Learn

We’ll guide you through 4 essential components of a production Coordinator setup:
1

Prediction Task Definition

Understanding the Condor prediction challenge - forecasting asset price distributions over multiple time horizons, including the TrackerBase interface that all participant models must implement.
2

Model Implementations (Cruncher Side)

Exploring the base class interface and example models that participants create to compete in the game. Learn how models receive market data via tick() and generate predictions via predict().
3

Coordinator Workers Architecture

Deep dive into the three-worker architecture: - Predict Worker: Real-time model orchestration and prediction collection - Score Worker: Distribution-based scoring with rolling windows - Report Worker: Leaderboard and metrics API
4

Local Development Setup

Running the complete stack locally with Docker, including the Model Orchestrator, PostgreSQL database, and all three workers. Test with example models before going live.
By the end of this guide, you’ll understand how to build a production-grade Coordinator for complex prediction tasks!

Architecture Overview

The Condor architecture separates concerns into specialized workers:
                        +-------------------+
                        |   Your business   |
                        |  (trading, API,   |
                        |   analytics...)   |
                        +---------+---------+


                +-----------------+-----------------+
                | Predict / Score / Report workers |
                +-----------+----------------------+


                    ModelRunner client


                   +--------+--------------------+
                   |      Model Orchestrator     |
                   +--------+-----------+--------+

              +-------------+-------------+
              │                           │
              ▼                           ▼
        Blockchain                  Participant models
  (identity, signatures)     (code submitted by crunchers)

Prediction Task Definition

Next, we’ll explore the Condor prediction task and the TrackerBase interface that all models must implement.