Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 25.1.0
# Keep in sync with the black version resolved in uv.lock (and used by
# `uv run black` / CI). black formatting changes between releases, so a
# stale rev here reformats differently than CI and fights the pipeline.
rev: 26.5.1
hooks:
- id: black
language_version: python3.11
Expand Down
119 changes: 60 additions & 59 deletions README.md

Large diffs are not rendered by default.

136 changes: 0 additions & 136 deletions docs/validator_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
- [5. Options](#5-options)
- [5.1. Common Options](#51-common-options)
- [`--axon.port INTEGER`](#--axonport-integer)
- [`--sma.low.days INTEGER`](#--smalowdays-integer)
- [`--sma.high.days INTEGER`](#--smahighdays-integer)
- [`--softmax.low.beta FLOAT`](#--softmaxlowbeta-float)
- [`--softmax.high.beta FLOAT`](#--softmaxhighbeta-float)
- [`--cycle_interval_minutes.low INTEGER`](#--cycle_interval_minuteslow-integer)
- [`--cycle_interval_minutes.high INTEGER`](#--cycle_interval_minuteshigh-integer)
- [`--logging.debug`](#--loggingdebug)
Expand Down Expand Up @@ -287,138 +283,6 @@ pm2 start validator.test.config.js -- --axon.port 8091

<sup>[Back to top ^][table-of-contents]</sup>

#### `--sma.low.days INTEGER`

The window for the simple moving average (SMA) of the validator scores for the 24h prompt.

Default: `10`

Example:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--sma.low.days 10",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --sma.low.days 10
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--sma.high.days INTEGER`

The window for the simple moving average (SMA) of the validator scores for the 1h prompt.

Default: `3`

Example:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--sma.high.days 3",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --sma.high.days 3
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--softmax.low.beta FLOAT`

Negative beta to give higher weight to lower scores for the 24h prompt

Default: `-0.1`

Example:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--softmax.low.beta -0.1",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --softmax.low.beta -0.1
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--softmax.high.beta FLOAT`

Negative beta to give higher weight to lower scores for the 1h prompt

Default: `-0.2`

Example:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--softmax.high.beta -0.2",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --softmax.high.beta -0.2
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--cycle_interval_minutes.low INTEGER`

Cycle interval in minutes for the 24h prompt.
Expand Down
20 changes: 0 additions & 20 deletions entrypoint-validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ mainnet_netuid=50
netuid=${NETUID:-$mainnet_netuid}

vpermit_tao_limit=999999
default_softmax_beta_low=-0.4
softmax_beta_low="${SOFTMAX_BETA_LOW:-$default_softmax_beta_low}"
default_softmax_beta_high=-0.4
softmax_beta_high="${SOFTMAX_BETA_HIGH:-$default_softmax_beta_high}"
default_sma_days_low=10
sma_days_low="${SMA_DAYS_LOW:-$default_sma_days_low}"
default_sma_days_high=5
sma_days_high="${SMA_DAYS_HIGH:-$default_sma_days_high}"

default_validator_coldkey_name=validator
validator_coldkey_name="${VALIDATOR_COLDKEY_NAME:-$default_validator_coldkey_name}"
Expand All @@ -31,10 +23,6 @@ python3.11 ./neurons/validator.py \
--netuid $netuid \
--logging.debug \
--neuron.axon_off true \
--sma.low.days $sma_days_low \
--sma.high.days $sma_days_high \
--softmax.low.beta $softmax_beta_low \
--softmax.high.beta $softmax_beta_high \
--neuron.vpermit_tao_limit $vpermit_tao_limit \
--gcp.log_id_prefix $log_id_prefix \
--neuron.nprocs 8 \
Expand All @@ -48,10 +36,6 @@ python3.11 ./neurons/validator.py \
--netuid $netuid \
--logging.debug \
--neuron.axon_off true \
--sma.low.days $sma_days_low \
--sma.high.days $sma_days_high \
--softmax.low.beta $softmax_beta_low \
--softmax.high.beta $softmax_beta_high \
--neuron.vpermit_tao_limit $vpermit_tao_limit \
--gcp.log_id_prefix $log_id_prefix \
--neuron.nprocs 8 \
Expand All @@ -65,10 +49,6 @@ python3.11 ./neurons/validator.py \
--netuid $netuid \
--logging.debug \
--neuron.axon_off true \
--sma.low.days $sma_days_low \
--sma.high.days $sma_days_high \
--softmax.low.beta $softmax_beta_low \
--softmax.high.beta $softmax_beta_high \
--neuron.vpermit_tao_limit $vpermit_tao_limit \
--gcp.log_id_prefix $log_id_prefix \
--neuron.nprocs 8 \
Expand Down
2 changes: 1 addition & 1 deletion miner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
name: "miner",
interpreter: "python3",
script: "./neurons/miner.py",
args: "--netuid 50 --logging.debug --logging.trace --wallet.name miner --wallet.hotkey default --axon.port 8091 --blacklist.force_validator_permit true --blacklist.validator_min_stake 1000",
args: "--netuid 50 --logging.debug --logging.trace --wallet.name miner --wallet.hotkey default --axon.port 8091 --blacklist.force_validator_permit true --blacklist.validator_min_stake 65000",
Comment thread
Thykof marked this conversation as resolved.
Comment thread
Thykof marked this conversation as resolved.
env: {
PYTHONPATH: ".",
},
Expand Down
46 changes: 19 additions & 27 deletions neurons/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from synth.validator.miner_data_handler import MinerDataHandler
from synth.validator.price_data_provider import PriceDataProvider
from synth.validator.storage_backend import STORAGE_BACKEND_BIGTABLE
from synth.validator import competition_config
from synth.validator.prompt_config import (
PromptConfig,
LOW_FREQUENCY,
Expand Down Expand Up @@ -89,10 +90,6 @@ def __init__(self, config=None, cycle_name: str = CYCLE_LOW_FREQUENCY):
self.price_data_provider = PriceDataProvider()

self.miner_uids: list[int] = []
LOW_FREQUENCY.softmax_beta = self.config.softmax.low.beta
HIGH_FREQUENCY.softmax_beta = self.config.softmax.high.beta
LOW_FREQUENCY.window_days = self.config.sma.low.days
HIGH_FREQUENCY.window_days = self.config.sma.high.days
LOW_FREQUENCY.data_retention_days = self.config.retention.low.days
HIGH_FREQUENCY.data_retention_days = self.config.retention.high.days
LOW_FREQUENCY.cycle_interval_minutes = (
Expand Down Expand Up @@ -246,36 +243,31 @@ def forward_score(self):
# with predictions and calculate the rewards,
# we store the rewards in the miner_scores table
# ========================================== #
bt.logging.info(
f"forward score {LOW_FREQUENCY.label} frequency", "forward_score"
)
competitions = [
competition_config.COM_EQU_24H,
competition_config.CRYPTO_24H,
competition_config.CRYPTO_1H,
]
Comment thread
Thykof marked this conversation as resolved.
Outdated

current_time = get_current_time()
scored_time: datetime = round_time_to_minutes(current_time)

success_low = calculate_scores(
self.miner_data_handler,
self.price_data_provider,
scored_time,
LOW_FREQUENCY,
self.config.neuron.nprocs,
)
success_count = 0
for comp in competitions:
bt.logging.info(f"forward score {comp.label}", "forward_score")

scored_time: datetime = round_time_to_minutes(current_time)
current_time = get_current_time()
bt.logging.info(
f"forward score {HIGH_FREQUENCY.label} frequency", "forward_score"
)
success_high = calculate_scores(
self.miner_data_handler,
self.price_data_provider,
scored_time,
HIGH_FREQUENCY,
self.config.neuron.nprocs,
)
if calculate_scores(
self.miner_data_handler,
self.price_data_provider,
scored_time,
comp,
self.config.neuron.nprocs,
):
success_count += 1

self.cleanup_history()

if not success_low and not success_high:
if success_count == 0:
return

# ================= Step 4 ================= #
Expand Down
28 changes: 0 additions & 28 deletions synth/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,6 @@ def add_validator_args(_, parser: argparse.ArgumentParser):
default="full",
)

parser.add_argument(
"--sma.low.days",
type=int,
help="Window for the simple moving average (SMA) of the validator scores for the low frequency prompt.",
default=10,
)

parser.add_argument(
"--sma.high.days",
type=int,
help="Window for the simple moving average (SMA) of the validator scores for the high frequency prompt.",
default=3,
)

parser.add_argument(
"--retention.low.days",
type=int,
Expand All @@ -282,20 +268,6 @@ def add_validator_args(_, parser: argparse.ArgumentParser):
default=4,
)

parser.add_argument(
"--softmax.low.beta",
type=float,
help="Negative beta to give higher weight to lower scores for the low frequency prompt.",
default=-0.1,
)

parser.add_argument(
"--softmax.high.beta",
type=float,
help="Negative beta to give higher weight to lower scores for the high frequency prompt.",
default=-0.2,
)

parser.add_argument(
"--cycle_interval_minutes.low",
type=int,
Expand Down
9 changes: 1 addition & 8 deletions synth/utils/sequential_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta, timezone
from datetime import datetime, timedelta
import time


Expand Down Expand Up @@ -39,13 +39,6 @@ def run_cycle(
prompt_config = self.prompt_config

asset_list = prompt_config.asset_list
if get_current_time() <= datetime(
2026, 4, 10, 14, 0, 0, tzinfo=timezone.utc
):
if prompt_config.label == "low":
asset_list = prompt_config.asset_list[:9]
elif prompt_config.label == "high":
asset_list = prompt_config.asset_list[:4]

delay = self.select_delay(
cycle_start_time,
Expand Down
Loading
Loading