Skip to main content
Now that you understand the Crunch Node and the challenge package through the default scaffold, this guide walks you through customizing them to build your own Crunch.

Build your custom Crunch Node (8:08)

You will:
  1. Update the model interface for your prediction task
  2. Build your scoring function
  3. Configure the Crunch Node
  4. Customize the challenge package for participants
  5. Test the full loop locally

Your workspace

When you ran crunch-node init my-challenge, you got this structure:
The node/docker-compose.yml setup uses this local webapp/ clone as the build context for report-ui, so you can evolve the dashboard UI alongside your node and challenge package.

Step 1: Define your prediction task

Your prediction task defines what participants need to predict and how their models interact with your Crunch Node.

Design the model interface

Edit challenge/starter_challenge/tracker.py to define the contract between your node and every Cruncher submission. Ask yourself:
  • What data will models receive? (e.g., price ticks, tabular features, images)
  • What should models return? (e.g., a class label, a probability distribution, a numeric value)
  • What methods do models need? (e.g., tick + predict, or train + infer)
The default TrackerBase uses a tick()predict() pattern for real-time streaming:
For a batch classification problem, you might use a completely different pattern:

Define output types

Update your CrunchConfig in node/config/crunch_config.py to match the types your models will produce:
The MODEL_BASE_CLASSNAME in node/.local.env must match your tracker class path. For example, if your package is my_challenge and the class is MyModelBase, set MODEL_BASE_CLASSNAME=my_challenge.model_base.MyModelBase.

Step 2: Build your scoring function

Edit challenge/starter_challenge/scoring.py to implement your evaluation logic:
Then point the score worker at your function in node/.local.env:

Choose your evaluation approach

Configure multi-metric scoring

Beyond your per-prediction scoring function, the engine computes portfolio-level metrics. Configure which ones in your CrunchConfig:

Choose your payout schedule

Set CHECKPOINT_INTERVAL_SECONDS in node/.local.env:
  • Continuous payouts — e.g., 604800 (1 week) for ongoing competitions with live data
  • One-time payout — set a long interval and trigger manually at competition end
See Crunch lifecycle for the full checkpoint and payout flow.

Step 3: Configure the Crunch Node

Edit node/.local.env with your competition settings:
For advanced customization, you can override additional callables via environment variables:

Step 4: Customize the challenge package

Update the participant-facing package:
1

Update the model interface

Edit challenge/starter_challenge/tracker.py with your base class (done in Step 1).
2

Write quickstarter examples

Replace the default examples in challenge/starter_challenge/examples/ with working models for your competition. Provide at least one that participants can submit immediately.
3

Update the scoring function

Edit challenge/starter_challenge/scoring.py with your evaluation logic (done in Step 2). This lets participants score locally.
4

Configure backtest data

Update challenge/starter_challenge/config.py so the backtest harness knows where to fetch historical data from your Crunch Node.
5

Update package metadata

Edit challenge/pyproject.toml — change the package name, version, and description.
6

Publish to PyPI

Step 5: Test the full loop locally

Finishing a Custom Crunch Node Implementation (4:38)

With your customizations in place, run the complete stack:
Then verify:
  1. Models connect — Open the Coordinator Platform at http://localhost:3000 and check that test models appear
  2. Predictions flow — Submit a test model and confirm predictions are being collected
  3. Scoring works — Wait for the scoring interval to pass, then check the leaderboard
  4. API returns data — Hit http://localhost:8000/reports/leaderboard to verify results
You can also run the full preflight check:
This validates config, deploys, checks model connectivity, and runs end-to-end verification.
Scoring requires ground truth. If your predictions have a 1-minute horizon, you need to wait 1 minute before scores appear on the leaderboard.

Checklist

Before moving to deployment, confirm:
  • Model interface defined in challenge/starter_challenge/tracker.py
  • Scoring function implemented in challenge/starter_challenge/scoring.py
  • CrunchConfig updated in node/config/crunch_config.py
  • Environment variables set in node/.local.env
  • Quickstarter examples work and are easy to modify
  • Backtest harness fetches data and produces scores
  • Full loop works end-to-end with make preflight
  • Challenge package published to PyPI

Next: Wallet & CLI setup

Set up your Solana wallet and register as a Coordinator on the protocol.