The Precog Subnet will serve as an arena to identify the analysts with the best strategies and information to anticipate Bitcoin price movements, and recruit them to share their insight with the broader community. By leveraging Bittensor’s subnet structure multiple perspectives can compete with the collective goal of filtering out noise in price signals. The open ecosystem creates a mechanism for people with unique knowledge to benefit themselves in exchange for sharing their specialties with the public
The initial focus is on Bitcoin as it is the most well-established and arguably most decentralized crypto currency. Bitcoin has an abundance of high-resolution data, while still retaining enough volatility to make price prediction a valuable challenge.
We decided to focus on high-frequency predictions (every 5 minutes) with short resolution times (every hour) because we believe this leverages the unique capabilities of Bittensor to do something that traditional derivatives markets cannot do. While options and futures allow markets to express sentiments around asset price, they are unable to do so in a continuously and with such a short settlement time.
The incentive mechanism was specifically designed to reward precise statements of the future price level, as well as the most likely band the price will trade in. Compared to mechanisms with less precise “long” or “short” predictions, and pre-determined strike price intervals, we believe the metrics we query are closer to what traders and analysts truly want: the most likely price in the future with frequent updates.
Validator | Miner |
---|---|
8gb RAM | 8gb RAM |
2 vCPUs | 2 vCPUs |
First, install PM2:
sudo apt update
sudo apt install nodejs npm
sudo npm install pm2@latest -g
Verify installation:
pm2 --version
Clone the repository:
git clone https://github.com/coinmetrics/precog.git
cd precog
Create and source a python virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install the requirements with poetry:
pip install poetry
poetry install
Start by editing the Makefile with your wallet and network information:
################################################################################
# User Parameters #
################################################################################
coldkey = default
validator_hotkey = validator
miner_hotkey = miner
netuid = $(testnet_netuid)
network = $(testnet)
Copy the example .env
files and edit all desired values:
cp .env.validator.example .env.validator
Edit .env.validator
with your desired values.
cp .env.miner.example .env.miner
Edit .env.miner
with your desired values.
Wandb integration is planned for mainnet launch and does not currently work.
Base miner:
- Run the command:
make miner ENV_FILE=.env.miner
Custom miner:
- Write a custom forward function stored in
precog/miners/your_file.py
miner.py
searches for a function calledforward
contained within your provided file--forward_function your_file
- This function should handle how the miner responds to requests from the validator
- Within the forward function,
synapse.predictions
andsynapse.interval
should be set. - See base_miner.py for an example
- Add a command to Makefile.
- copy the miner command and rename it (e.g. miner_custom) in Makefile
- replace the
--forward_function base_miner
with--forward_function your_file
- Run the Command:
make miner_custom ENV_FILE=.env.custom
make validator ENV_FILE=.env.validator
Read the Incentive mechanism whitepaper for an in-depth explanation of the mechanism.
Briefly, miners are rewarded based on two factors:
- A point estimate for the price of BTC in USD one hour from prediction time
- An interval estimate (the minimum and maximum price of BTC over the next hour based on a 1s frequency)
For more information, feel free to investigate reward.py or base_miner.py
Our goal is to continuously improve the subnet and tune it to the goals and interests that will engage the community. We have considered additions in the form of additional asset coverage, such as extending price analysis to TAO tokens. Extensions can also mean incentive mechanisms to calculate new types of metrics such as anticipating volatility, transaction volumes, or the cost of different types of transfers. Our greatest strength is our deep and professional data library, used by many of the largest financial institutions in crypto. We expect these resources will allow the subnet scope to adapt quickly when conditions are right.
We hope to, on one hand, leverage our existing products and coverage to make generating new insights as frictionless as possible for Miners. While on the other hand, we also hope to integrate new data streams into our catalog that only the Bittensor ecosystem can generate. Our aim is for these novel outputs to ultimately bring new participants to Bittensor from the broader crypto community, as we serve metrics and analysis that can't be obtained anywhere else.