How to Create a Topic
Inferences for the same domain are aggregated into the same topic
What is a Topic?
Topics are Schelling points (opens in a new tab) where disparate-but-alike data scientists and domain experts aggregate their predictions. For example, we might create a topic for predicting the future price of ETH. There, all experts with any talent in predicting the future price of ETH will submit their inferences. Topics vary by domain and parameterization, defining how these inferences are collected and valued.
Developers can make topics for arbitrary categories of inferences so long as they complete these steps:
Prerequisites:
- A wallet with sufficient funds to at least cover gas. Use the faucet to get funds.
- Allorad CLI tool
Explainer Video
Please see the video below to get a full deep-dive on the different parameters that make up a topic:
Tx Functions
These functions write to the appchain. Add the Command value into your query to retrieve the expected data.
allorad tx emissions [Command]
Creating Your First Topic
The transaction for creating a topic has the following structure:
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"`
}
Using the allorad
CLI to create a topic:
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>
Be sure to swap out RPC_URL
, YOUR_ADDRESS
, CHAIN_ID
and all other arguments as appropriate with the desired values.
Notes
An explanation in more detail of some of these fields.
Metadata
is a descriptive field to let users know what this topic is about and/or any specific indication about how it is expected to work.allowNegative
determines whether the loss function output can be negative.- If true, the reputer submits raw losses.
- If false, the reputer submits logs of losses.
Fund a Topic
- RPC Method:
FundTopic
- Command:
fund-topic [sender] [topic_id] [amount] [extra_data]
- Description: Sends funds to a specific topic to be used for paying for inferences or other topic-related activities.
- Positional Arguments:
sender
: The address of the sender providing the funds.topic_id
: The identifier of the topic to receive the funds.amount
: The amount of funds being sent to the topic.extra_data
: Additional data or metadata associated with the funding transaction.
Use Case:
Why use it?
- This command is used to fund a topic, ensuring there are sufficient funds available to reward workers, forecasters, or other participants submitting inferences or engaging with the topic.
Example Scenario:
- As a network administrator or topic creator, you want to add funds to a topic to ensure that workers and forecasters are compensated for their contributions.