Developers
Topic Creators
How to Create/Fund a Topic using allorad

How to Create a Topic

Overview

Topics are Schelling points (opens in a new tab) where workers submit predictions on specific questions (e.g., "What will ETH price be in 24 hours?"). The network aggregates these predictions through consensus mechanisms and rewards workers based on accuracy.

Create topics to define new categories of predictions the network can provide. Topics specify what to predict, how often, how accuracy is measured, and how rewards are distributed.

Prerequisites

  1. Wallet with sufficient funds for gas. Use the faucet for testnet tokens.
  2. Allorad CLI tool installed and configured.

Video Tutorial

Topic Structure

Topics are created with MsgCreateNewTopic:

type MsgCreateNewTopic struct {
  // Address of the wallet that will own the topic
  Creator          string   `json:"creator,omitempty"`
  // Information about the topic
  Metadata         string   `json:"metadata,omitempty"`
  // The method used for loss calculations
  LossMethod       string   `json:"loss_method,omitempty"`
  // The frequency (in blocks) of inference calculations (Must be greater than 0)
  EpochLength      int64    `json:"epoch_length,omitempty"`
  // The time it takes for the ground truth to become available (Cannot be negative)
  GroundTruthLag   int64    `json:"ground_truth_lag,omitempty"`
  // the time window within a given epoch that worker nodes can submit an inference
  WorkerSubmissionWindow int64 `json:"worker_submission_window"`
  // Raising this parameter raises how much high-quality inferences are favored over lower-quality inferences (Must be between 2.5 and 4.5)
  PNorm            github_com_allora_network_allora_chain_math.Dec `json:"p_norm"`
  // Raising this parameter lowers how much workers historical performances influence their current reward distribution (Must be between 0 and 1)
  AlphaRegret      github_com_allora_network_allora_chain_math.Dec  `json:"alpha_regret"`
  // Indicates if the loss function's output can be negative. If false, the reputer submits logs of losses; if true, the reputer submits raw losses.
  AllowNegative    bool     `json:"allow_negative,omitempty"`
  // the numerical precision at which the network should distinguish differences in the logarithm of the loss
  Epsilon          github_com_allora_network_allora_chain_math.Dec  `json:"epsilon"`
  MeritSortitionAlpha github_com_allora_network_allora_chain_math.Dec  `json:"merit_sortition_alpha"`
  ActiveInfererQuantile github_com_allora_network_allora_chain_math.Dec `json:"active_inferer_quantile"`
  ActiveForecasterQuantile github_com_allora_network_allora_chain_math.Dec `json:"active_forecaster_quantile"`
  ActiveReputerQuantile github_com_allora_network_allora_chain_math.Dec `json:"active_reputer_quantile"`
}

Create Topic Command

allorad tx emissions create-topic \
  allo13tr5nx74zjdh7ya8kgyuu0hweppnnx8d4ux7pj \    # Creator address
  "ETH prediction in 24h" \                          # Metadata
  "mse" \                                            # LossMethod
  3600 \                                             # EpochLength
  0 \                                                # GroundTruthLag
  3 \                                                # WorkerSubmissionWindow
  3 \                                                # PNorm
  1 \                                                # AlphaRegret
  true \                                             # AllowNegative
  0.001 \                                            # Epsilon
  0.1 \                                              # MeritSortitionAlpha
  0.25 \                                             # ActiveInfererQuantile
  0.25 \                                             # ActiveForecasterQuantile
  0.25 \                                             # ActiveReputerQuantile
  --node <RPC_URL>
  --chain-id <CHAIN_ID>

Replace RPC_URL, creator address, and CHAIN_ID with your values.

Parameter Reference

Basic Configuration

Creator: Your wallet address. Topic owner with administrative control.

Metadata: Human-readable description of what the topic predicts. Include specifics about the prediction target and methodology.

LossMethod: How prediction accuracy is measured. Common value: "mse" (Mean Squared Error).

Timing Parameters

EpochLength: How often new predictions are requested, measured in blocks. Must be > 0.

  • Shorter epochs = more frequent predictions
  • Consider block time when setting (e.g., 3600 blocks ≈ 1 hour if block time is 1 second)

GroundTruthLag: Blocks between prediction and when ground truth becomes available. Cannot be negative.

  • For price predictions: Time until authoritative price data is available
  • For event predictions: Time until outcome is known

WorkerSubmissionWindow: Blocks within each epoch that workers can submit inferences.

  • Balances timeliness with participation opportunity
  • Too short: workers may miss deadline
  • Too long: reduces prediction freshness

Consensus Parameters

PNorm: Controls how much high-quality inferences are favored over lower-quality ones. Range: 2.5-4.5.

  • Higher values increase the weight given to more accurate workers
  • Lower values distribute rewards more evenly across workers

AlphaRegret: Controls how much historical performance influences current rewards. Range: 0-1.

  • Higher values = less influence from past performance, more weight on recent accuracy
  • Lower values = more weight on long-term track record

AllowNegative: Whether loss function output can be negative.

  • false: Reputers submit log(loss) values
  • true: Reputers submit raw loss values
  • Depends on your loss function's output range

Precision and Participation

Epsilon: Numerical precision for distinguishing differences in log-loss calculations.

  • Smaller values = finer distinctions between similar losses
  • Affects how sensitively rewards respond to accuracy differences

MeritSortitionAlpha: Weight given to merit in participant selection. Typical value: 0.1.

Active Participant Quantiles: Proportion of each participant type selected for activity:

  • ActiveInfererQuantile: Proportion of workers selected
  • ActiveForecasterQuantile: Proportion of forecasters selected
  • ActiveReputerQuantile: Proportion of reputers selected
  • Typical value: 0.25 (25%) for all three

These quantiles determine how many participants are chosen to actively contribute in each epoch, balancing network load with decentralization.

Topic Funding

Topics require funding to pay participant rewards. Use the fund-topic command:

allorad tx emissions fund-topic \
  [sender_address] \
  [topic_id] \
  [amount] \
  [extra_data] \
  --node <RPC_URL> \
  --chain-id <CHAIN_ID>

Parameters:

  • sender: Your wallet address providing funds
  • topic_id: Topic identifier (returned when topic is created)
  • amount: Funds to add to topic (in network tokens)
  • extra_data: Optional metadata

Monitor topic funding levels to ensure continuous operation. Topics without sufficient funding may stop rewarding participants.

Configuration Examples

High-Frequency Price Prediction

EpochLength: 300              # 5 minutes
GroundTruthLag: 0             # Immediate price data
WorkerSubmissionWindow: 60    # 1 minute to submit
PNorm: 3.5                    # Emphasize accuracy
AlphaRegret: 0.8              # Weight recent performance

Daily Event Prediction

EpochLength: 86400            # 24 hours
GroundTruthLag: 86400         # Results available next day
WorkerSubmissionWindow: 3600  # 1 hour to submit
PNorm: 3.0                    # Balanced accuracy weighting
AlphaRegret: 0.3              # Consider historical performance

Next Steps

Understand topic lifecycle for ongoing management and query topic data to monitor activity.

Deploy a worker to start submitting predictions to your topic.