Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Latest commit

 

History

History
359 lines (197 loc) · 15.3 KB

File metadata and controls

359 lines (197 loc) · 15.3 KB

Miner

You will be receiving data in the form defined in neurons/protocol.py and will only need to complete the probability entry.

You will be receiving requests from validators every 3-5 minute. You do not have to recalculate your prediction every time. Our baseline miner is implementing a caching system that allows for a recalculation schedule. This is particularly important if you use a base model like GPT4 that might be expensive.

General

Before registering your miner on the main network you can register it on testnet. Our testnet netuid is 155. You will also need faucet TAO. You can ask for them here. If you have any difficulties please reach out on our discord channel, we can then send them to you as well here.

To register on mainnet you will need real TAO. Our mainnet uid is 6. You can get TAO by swapping them against USDC on an exchange like MEXC. Other exchanges supporting TAO are listed here. We give steps below on creating your own wallet from btcli. The registration cost fluctuates depending on the current demand to register on the network. After you register there is an immunity period during which you cannot be excluded, if you are the lowest miner at the end of it you are deregistered.

Here are entries in the Bittensor documentation for miners and coldkeys.

Key insights into the scoring system

  • You have to predict all events, you get the worst score if you don't sent a prediction for a given time interval (current each interval lasts 4h) on a given event
  • You are mostly rewarded for your early predictions (there is an exponentially decaying window, updating over 4h intervals)
  • In the new peer score system if you are a new miner we give you a score of $0$ on all the intervals for which you could not submit a prediction but where the associated question is taken into account in your score (in the legacy system we assume you sent 0.5)

Baseline Miner

We integrate an LLM pipeline based on the forecasting-tools repository. Please refer to the last part of the Getting Started section below for setup instructions.

Relevant Research

A reference providing a baseline strategy for miners is the article "Approaching Human Level Forecasting with Language Models" ([1]). The authors fine-tune an LLM to generate predictions on binary events (including the ones listed on Polymarket) which nears the performance of human forecasters when submitting a forecast for each prediction, and which beats human forecasters in a setting where the LLM can choose to give a prediction or not based on its confidence.

The authors released a version of the code they used to build the LLM they describe in the paper. You can find it here.

System requirements

The computational requirements for a miner using our public miner are 50GB of hard drive and 4-8GB of RAM. Any custom implementation should do its own evaluation.

A significant cost in the case of the repo referenced above is the cost of using e.g the OpenAI API as well as the cost of retrieving news data. Common news providers are Perplexity and Ask News.

Background information on event types

You can get the list of ongoing events using the following API endpoint.

LLM

The events are generated by our internal LLM event generators based triggers coming from Ask News and Polymarket. They are focused on geopolitics and politics.

Here are examples:

"Will the US Department of State or the US Department of Defense confirm, via an official announcement, the delivery of a new arms package (i.e., one that has not been previously announced or confirmed) to Ukraine by March 20, 2025 23:59 UTC?"

"Will the Trump administration exclude tariffs on cars by April 2, 2025?"

Fred

The events are constructed based on the time series of certain economic indicators listed on Fred. They ask whether a given indicator will be greater than a value obtained through a least squares method.

Here is an example:

Will the value of 5-Year 0.125% Treasury Inflation-Indexed Bond, Due 4/15/2025 be strictly greater than -2.44 % at 2025-03-27 ?

Crypto

The events ask about key indicators (max/min price, market cap, trading volume) related to major cryptocurrencies (BTC, ETH, TAO).

Here are examples:

Will the market capitalization of Bitcoin (BTC) increase by more than 4.2467% on 2025-03-25?

Will the 24-hour trading volume of Ethereum (ETH) exceed 12603592599.0 USD on 2025-03-25?

Will the price of Bittensor (TAO) reach 283.31 USD at any time on 2025-03-25?

Earnings

Given an earning report is published, we ask whether the opening price the day after the report will be higher than the last closing price.

Here is an example:

Will the earnings announcement for LOCL (Local Bounti Corp) on 2025-03-28 result in an opening stock price on 2025-03-31 that is higher than the closing stock price on 2025-03-28?

Polymarket

We stream some subset of the markets listed on Polymarket. Currently these are markets that when received have a midprice between 0.2 and 0.8. Soon these will be mostly the markets that are used to trigger our LLM generated event clusters.

Getting Started

First you can immediately experiment with a miner on testnet using codespace.

  1. Open a codespace on our main branch
  2. Follow step 2 to 3, creating a wallet named validator
  3. Type miner_testnet and your miner is running

1a. Set up your server

We recommend the following cloud providers:

The most important is that your bot should be able to continuously respond to incoming requests from validators. There is a penalty for downtime.

1. Setup the environment

First clone this repo by running git clone . Then to run a miner:

Clone repository

git clone https://github.com/amedeo-gigaver/infinite_games.git

Change directory

cd infinite_games

Create Virtual Environment

python -m venv venv

Activate a Virtual Environment

source venv/bin/activate

Install dependencies

pip install -r requirements.txt

The venv should be active whenever the neurons are run.

2. Create Wallets

This step creates local coldkey and hotkey pairs for your miner. Both of these items can be shared (for example you have to share you coldkey to get faucet tokens and these will appear on Taostats). Do not share your mnemonic.

Create a coldkey and hotkey for your miner wallet.

btcli wallet new_coldkey --wallet.name miner
btcli wallet new_hotkey --wallet.name miner --wallet.hotkey default

2a. Getting faucet tokens

Ask the Bittensor Discord community for faucet tokens here. Post your request in the "Requests for Testnet TAO" thread using the following format:

  • Testnet netuid: 155
  • Mainnet netuid : 6
  • Roles: Miner
  • Coldkey : - paste your coldkey here -
  • Do you have your mnemonic phrase for the coldkey written down in a safe place? Yes

If you encounter any issue please reach out to our team on the subnet's Discord channel.

We strongly encourage you to register on testnet first.

3. Register keys

This step registers your subnet miner keys to the subnet. This ensures that the miner can run the respective miner scripts.

btcli subnet register --wallet.name miner --wallet.hotkey default

To register your miner on the testnet add the --subtensor.network test flag.

Follow the below prompts:

>> Enter netuid (0): # Enter the appropriate netuid for your environment
Your balance is: # Your wallet balance will be shown
The cost to register by recycle is τ0.000000001 # Current registration costs
>> Do you want to continue? [y/n] (n): # Enter y to continue
>> Enter password to unlock key: # Enter your wallet password
>> Recycle τ0.000000001 to register on subnet:6? [y/n]: # Enter y to register
📡 Checking Balance...
Balance:
  τ5.000000000 ➡ τ4.999999999
✅ Registered

4. Check that your keys have been registered

This step returns information about your registered keys.

Check that your miner key has been registered:

btcli wallet overview --wallet.name miner

To check your miner on the testnet add the --subtensor.network test flag

The above command will display the below:

Subnet: 6 (or 155 on testnet)
COLDKEY    HOTKEY   UID  ACTIVE  STAKE(τ)     RANK    TRUST  CONSENSUS  INCENTIVE  DIVIDENDS  EMISSION(ρ)   VTRUST  VPERMIT  UPDATED  AXON  HOTKEY_SS58
miner  default  197    True   0.00000  0.00000  0.00000    0.00000    0.00000    0.00000            0  0.00000                56  none  5GKkQKmDLfsKaumnkD479RBoD5CsbN2yRbMpY88J8YeC5DT4
1          1        1            τ0.00000  0.00000  0.00000    0.00000    0.00000    0.00000           ρ0  0.00000
                                                                                Wallet balance: τ0.000999999

5. Check that you accepting incoming validator requests

Please make sure your firewall doesn't block the port on which validators query your miner. The port can be specified with the argument --axon.port and by default it is 8091.

After you registered your miner on testnet, check in the logs if you are receiving forecasting events. If you receive forecasting events it means you are listening to the network. If you do not receive events, check the firewall of your provider.

Running a Miner

Direct Run

Run the following command inside the infinite_games directory to run your miner on testnet:

python neurons/miner.py --netuid 155 --subtensor.network test --wallet.name miner --wallet.hotkey default

Remove the testnet flag and change the netuid to 6 if you are on mainnet.

PM2 Installation

Install and run pm2 commands to keep your miner online at all times.

sudo apt update

sudo apt install npm

sudo npm install pm2 -g

Confirm pm2 is installed and running correctly

pm2 ls

Use the following example command to run the miner:

pm2 start neurons/miner.py --interpreter python3 --name miner -- --wallet.name miner --netuid 155 --wallet.hotkey default --subtensor.network test --logging.debug

Variables Explanation

--wallet.name: Provide the name of your wallet. --wallet.hotkey: Enter your wallet's hotkey. --netuid: Use 6 for mainnet and 155 for testnet. --subtensor.network: Specify the network you want to use (finney, test, local, etc). --logging.debug: Adjust the logging level according to your preference. --axon.port: Specify the port number you want to use.

Use the following commands to monitor the status and logs:

pm2 status pm2 logs 0

Useful PM2 Commands

The following commands will be useful for the management of your miner:

pm2 list # lists all pm2 processes

pm2 logs <pid> # replace pid with your process ID to view logs

pm2 restart <pid> # restart this pic

pm2 reload <pid> # reload this pic

pm2 stop <pid> # stops your pid

pm2 del <pid> # deletes your pid

pm2 describe <pid> # prints out metadata on the process

5. Stopping your miner

To stop your miner, press CTRL + C in the terminal where the miner is running.

6. Using the Built-in LLM forecaster

The repository includes a pre-built LLM (Language Model) forecaster at neurons/miner/forecasters/llm_forecaster.py that you can use for making predictions. To use it:

  1. Get the required API keys:

    • Perplexity API key
    • OpenAI API key
  2. Set your API keys as environment variables:

export PERPLEXITY_API_KEY=<your_perplexity_api_key>
export OPENAI_API_KEY=<your_openai_api_key>
  1. Open neurons/miner.py#L31 and locate the assign_forecaster function
  2. Replace the placeholder forecaster with LLMForecaster
  3. Start your miner - it will now use LLM models to forecast events

7. Creating Your Own Forecaster

You can create your own custom forecaster to implement different prediction strategies:

  1. Create a new forecaster class that inherits from the base forecaster (neurons/miner/forecasters/base.py)
  2. Implement the _run method in your forecaster
    • This method must return a prediction value between 0 and 1
    • You can access event information through the MinerEvent class (neurons/miner/models/event.py)
  3. Update the assign_forecaster function in neurons/miner.py to use your forecaster

The assign_forecaster function lets you use different forecasters for different types of events. You can examine the event information and choose the most appropriate forecaster for each case.

8. Analysing the performance of your miner

Look into the following links for key data on the subnet:

Before you register your miner on mainnet you can use the data from the following sources in order to measure the accuracy of your miner and compare it to the accuracy of other miners using the leaderboard here:

After you registered your miner you can use this section of the main analytics dashboard to track your performance.

For a high level view of the network please refer to this view on Taostats. You can see the current real-time ranking by selecting the Metagraph section and the current incentive distribution in the Distribution section.