feat: migrate price feeds from Pyth to Binance + Hyperliquid, replace SPYX with SP500#304
Merged
Merged
Conversation
… 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>
Contributor
There was a problem hiding this comment.
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).BTCUSDT, …) — klines for scoring, price ticker for miner spotHYPE/USDC(@107)xyz:*)What changed
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.prompt_config), but SPYX stays incompetition_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.PYTH_API_KEY,LAZER_FEED_ID_MAP,.env.exampleentry) and thescripts/pyth-*.pydiscovery scripts are removed entirely.Miner-visible (announcement scheduled for 2026-07-21)
SP500prompted on Commodities/Equities 24h from the deploy; SPYX prompts stop.PYTH_API_KEY/Lazer/Hermes (Hermes kept only to serve SPYX prompts from laggard validators during rollout).Tests
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).black --check/flake8clean.🤖 Generated with Claude Code