Repository navigation
Add Hyperliquid market data and reusable weighted IP routing - #19
Merged
Merged
Conversation
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.
Agents can retrieve Hyperliquid public market metadata, mids, L2 books, available candles and paginated funding history through Dedomena’s native-record, provenance and replay contract. A reusable IPPool lets the same OpenAlex and Hyperliquid clients use configured local IP bindings or HTTP(S) proxies.
Hyperliquid accepts only fixed public POST /info schemas. Trading and account actions fail before network access. Spot metadata and contexts retain their independent native shapes; decimals remain strings. Candles explicitly report incomplete history because only the latest 5,000 are retained. Funding checkpoints pin time bounds and deduplicate inclusive boundary rows, failing when a timestamp cannot be safely enumerated.
IP admission uses durable rolling weighted windows shared across workers and restarts. Hyperliquid’s 1,200 weight/minute/IP limit, route cooldowns, existing key/service pacing, and credit/byte reservations commit atomically. Count-sized responses reserve conservative maximum weight and reduce local accounting using rounded-up returned counts. Unknown sends retain reservations. Sources keep shared request identity/cache entries while receipts record the declared egress IP hash; route credentials stay out of provenance. The SDK and JSON CLI support a shared route configuration.
OpenAlex retains its 100 requests/second key ceiling and daily credit budget: current official documentation does not establish IP-only rate enforcement, so additional routes do not multiply key allowances. A deterministic ten-IP simulation admits 6,000 weight-2 requests/minute or 600 weight-20 requests/minute; these are capacity checks, not sustained network measurements.
Validation: 403 offline tests pass on Python 3.10 and 3.12; critical lint/diff checks pass; the 0.6.0 wheel builds and imports in an isolated Python 3.10 environment. Five bounded live Hyperliquid adapter queries returned HTTP 200 and passed snapshot replay, covering both metadata types, mids, candles and funding: 399,814 decoded bytes, 191 reserved weight and 85 locally accounted weight. Multi-IP live throughput remains unmeasured.
This PR builds on #17 and targets its branch to isolate this increment. Merge #17 first, then retarget to master. Documentation: docs/HYPERLIQUID.md, docs/IP_ROUTING.md and README. Follow-up #18 tracks a generic bounded parallel retrieval adapter.
Sanity
Tests