Skip to content

Commit 9944e53

Browse files
authored
refactor: should_skip_xau (#201)
1 parent cb26cc1 commit 9944e53

File tree

3 files changed

+0
-56
lines changed

3 files changed

+0
-56
lines changed

neurons/validator.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
round_time_to_minutes,
3333
)
3434
from synth.utils.logging import setup_gcp_logging
35-
from synth.utils.opening_hours import should_skip_xau
3635
from synth.validator.forward import (
3736
calculate_moving_average_and_update_rewards,
3837
calculate_scores,
@@ -162,11 +161,6 @@ def select_asset(
162161
latest_index = asset_list.index(latest_asset)
163162
asset = asset_list[(latest_index + 1) % len(asset_list)]
164163

165-
future_start_time = get_current_time() + timedelta(seconds=delay)
166-
future_start_time = round_time_to_minutes(future_start_time)
167-
if should_skip_xau(future_start_time) and asset == "XAU":
168-
asset = asset_list[(asset_list.index("XAU") + 1) % len(asset_list)]
169-
170164
return asset
171165

172166
def cycle_low_frequency(self, asset: str):
@@ -214,13 +208,6 @@ def forward_prompt(self, asset: str, prompt_config: PromptConfig):
214208
request_time, prompt_config.timeout_extra_seconds
215209
)
216210

217-
if should_skip_xau(start_time) and asset == "XAU":
218-
bt.logging.info(
219-
"Skipping XAU simulation as market is closed",
220-
"forward_prompt",
221-
)
222-
return
223-
224211
simulation_input = SimulationInput(
225212
asset=asset,
226213
start_time=start_time.isoformat(),

synth/utils/opening_hours.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/test_validator.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,3 @@ def test_select_asset(self):
5454
latest_asset, asset_list, 0
5555
)
5656
self.assertEqual(selected_asset, "LTC")
57-
58-
def test_select_asset_gold(self):
59-
latest_asset = "ETH"
60-
asset_list = ["BTC", "ETH", "XAU", "LTC"]
61-
62-
with patch(
63-
"neurons.validator.get_current_time"
64-
) as mock_get_current_time:
65-
mock_get_current_time.return_value = datetime(
66-
2025, 12, 3, 12, 36, 30, tzinfo=timezone.utc
67-
)
68-
with patch(
69-
"neurons.validator.should_skip_xau"
70-
) as mock_should_skip_xau:
71-
mock_should_skip_xau.return_value = True
72-
selected_asset = Validator.select_asset(
73-
latest_asset, asset_list, 0
74-
)
75-
self.assertEqual(selected_asset, "LTC")

0 commit comments

Comments
 (0)