Skip to content

feat: migrate price feeds from Pyth to Binance + Hyperliquid, replace SPYX with SP500#304

Merged
Thykof merged 3 commits into
mainfrom
feat/hyperliquid-price-feeds-sp500
Jul 20, 2026
Merged

feat: migrate price feeds from Pyth to Binance + Hyperliquid, replace SPYX with SP500#304
Thykof merged 3 commits into
mainfrom
feat/hyperliquid-price-feeds-sp500

Conversation

@Thykof

@Thykof Thykof commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Why

Pyth Pro is putting its API behind a paid key, including the history endpoint the validator scores against. All price feeds move to keyless venues, split per asset.

The feed map

One canonical pair of maps (BINANCE_ASSET_MAP, HYPERLIQUID_ASSET_MAP) shared by name between the validator (price_data_provider.py) and the reference miner (price_simulation.py) — a test asserts they stay equal. Dispatch: Binance → Hyperliquid → Pyth (SPYX rollout tail).

Asset Feed
BTC, ETH, SOL, XRP Binance spot (BTCUSDT, …) — klines for scoring, price ticker for miner spot
HYPE Hyperliquid spot HYPE/USDC (@107)
XAU, NVDAX, TSLAX, AAPLX, GOOGLX, SP500, SPCX, WTIOIL Hyperliquid perps (xyz:*)

What changed

  • SPYX is retired and replaced by a new asset SP500 (xyz:SP500, S&P 500 index scale, ~10x SPYX's level) rather than re-pointed: a 10x step inside one stored series would poison every vol/return lookback crossing it.
  • Rollout tail: prompting swaps at deploy (prompt_config), but SPYX stays in competition_config, ASSET_COEFFICIENTS, SIGMA_MAP, and a minimal Pyth path (validator history + miner Hermes spot) so in-flight requests are scored and SPYX scores age out of the 10-day moving-average window. SP500 inherits SPYX's coefficient and sigma. A follow-up cleanup release deletes SPYX and all remaining Pyth code ~10 days after deploy.
  • New Binance klines path in the validator mirrors the Hyperliquid one, including the settlement-witness guard (Binance prints klines eagerly, so the semantics match).
  • Pyth Lazer support (PYTH_API_KEY, LAZER_FEED_ID_MAP, .env.example entry) and the scripts/pyth-*.py discovery scripts are removed entirely.

Miner-visible (announcement scheduled for 2026-07-21)

  • New asset symbol SP500 prompted on Commodities/Equities 24h from the deploy; SPYX prompts stop.
  • Majors are scored on Binance spot klines; HYPE on its Hyperliquid spot market; equities/commodities on Hyperliquid perps.
  • Reference miner drops PYTH_API_KEY/Lazer/Hermes (Hermes kept only to serve SPYX prompts from laggard validators during rollout).

Tests

  • Mocked coverage for all three paths (Binance klines via session mock, Hyperliquid candleSnapshot, Pyth tail), settlement-guard tests per path, per-venue routing tests, and live per-asset history checks against the real endpoints — the live tests double as a tripwire for symbol renames (e.g. HIP-3 dex redeploys).
  • Full suite: 224 passed + 15 live subtests; black --check / flake8 clean.

🤖 Generated with Claude Code

Thykof and others added 2 commits July 17, 2026 15:26
… SP500

Pyth Pro is putting its API behind a paid key, including the history
endpoint the validator scores against. All price feeds move to
Hyperliquid (keyless, 24/7): validator ground-truth candles and the
reference miner's spot price share one HYPERLIQUID_ASSET_MAP.

SPYX (tokenized SPY) is retired and replaced by a new asset SP500
(xyz:SP500, index scale) rather than re-pointed — a 10x level step
inside one stored series would poison every vol/return lookback
crossing it. Prompting swaps at deploy; SPYX stays in the competition
config, coefficients, and a minimal Pyth path so in-flight requests
score and its scores age out of the 10-day moving-average window. A
cleanup release removes SPYX and the remaining Pyth code after the
tail.

Pyth Lazer support (PYTH_API_KEY) and the Pyth discovery scripts are
removed entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
BTC/ETH/SOL/XRP ground truth and miner spot move to Binance spot
(BTCUSDT, ...); HYPE moves to its Hyperliquid spot market (@107);
equities/commodities stay on Hyperliquid perps. The validator gains a
Binance klines path with the same settlement-witness guard as the
Hyperliquid one; the reference miner reads majors' spot from the
Binance price ticker. SPYX rollout tail on Pyth is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Thykof Thykof changed the title feat: migrate price feeds from Pyth to Hyperliquid, replace SPYX with SP500 feat: migrate price feeds from Pyth to Binance + Hyperliquid, replace SPYX with SP500 Jul 17, 2026
@Thykof
Thykof requested a review from Copilot July 17, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the subnet’s realized-price sourcing away from Pyth (due to Pyth Pro requiring paid keys for historical access) to keyless venues: Binance spot for crypto majors and Hyperliquid for spot/perps, while retiring SPYX in favor of SP500 (with a temporary SPYX “rollout tail” maintained for scoring continuity).

Changes:

  • Implement venue routing and data download paths in the validator: Binance spot klines (BTC/ETH/SOL/XRP), Hyperliquid candles (HYPE + equities/commodities), and a reduced Pyth Pro history path for SPYX rollout tail.
  • Update miner reference implementation to fetch spot prices from Binance/Hyperliquid and keep Hermes only for SPYX tail; remove Lazer/API-key support and discovery scripts.
  • Replace SPYX prompts/docs/tests with SP500 while keeping SPYX coefficients/sigmas and validator Pyth history support temporarily.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/utils.py Updates live-test timing rationale from Pyth windowing to Hyperliquid candle retention.
tests/test_price_data_provider.py Reworks mocks and adds coverage for Binance + Hyperliquid + SPYX Pyth-tail paths, including settlement-guard assertions and live per-asset checks.
tests/test_moving_average_unit.py Switches “realistic” test asset lists from SPYX to SP500.
tests/test_miner_price_simulation.py Updates miner spot routing tests (Binance/Hyperliquid) and keeps Hermes-only SPYX rollout-tail coverage; asserts miner/validator maps match.
tests/test_forward.py Updates comment to reflect Hyperliquid as the live history endpoint hit during tests.
synth/validator/prompt_config.py Updates prompt asset list to use SP500 instead of SPYX.
synth/validator/price_data_provider.py Adds Binance klines and Hyperliquid routing; reduces Pyth support to SPYX-only rollout tail; keeps settlement-witness guard semantics.
synth/validator/moving_average.py Adds SP500 coefficient while retaining SPYX for rollout tail.
synth/validator/competition_config.py Adds SP500 to the Commodities/Equities competition while retaining SPYX for tail continuity.
synth/miner/simulations.py Adds SP500 sigma (same as SPYX) and documents rollout tail intent.
synth/miner/price_simulation.py Implements Binance ticker + Hyperliquid candleSnapshot fetching; removes Lazer/API key flow; keeps Hermes for SPYX only.
scripts/pyth-listing.py Removes obsolete Pyth listing script.
scripts/pyth-lazer-listing.py Removes obsolete Lazer discovery/probing script.
README.md Updates competition asset lists, scoring feed documentation, and historical changelog entry for the migration + SP500 swap.
.env.example Removes PYTH_API_KEY env var example since Lazer support is removed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread synth/validator/competition_config.py
Comment thread tests/test_price_data_provider.py
api.binance.com returns HTTP 451 from US IPs, where the GitHub runners
live. The Binance URLs now honor a BINANCE_API_HOST process-env override
(default api.binance.com) and CI sets data-api.binance.vision, Binance's
public market-data host.

Scoring-pipeline tests (test_forward, prepare_random_predictions
consumers) switch their live-scored asset from BTC to HYPE — the only
CRYPTO_24H asset on Hyperliquid, reachable from any runner — so core
scoring coverage never depends on Binance reachability. The dedicated
Binance live tests skip cleanly on HTTP 451 instead of failing.

test_moving_average_writes_all_three_competitions now scores 30 days in
the past: it shares a module-scoped DB with tests that write live scores
near now, and its softmax outcome depended on which leaked rows fell
inside the window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Thykof
Thykof merged commit 4fd1518 into main Jul 20, 2026
5 checks passed
@Thykof
Thykof deleted the feat/hyperliquid-price-feeds-sp500 branch July 20, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants