Skip to content

Add Hyperliquid market data and reusable weighted IP routing - #19

Merged
mikkokotila merged 1 commit into
codex/finance-sourcesfrom
codex/hyperliquid-egress
Oct 2, 2026
Merged

mikkokotila merged 1 commit into
codex/finance-sourcesfrom
codex/hyperliquid-egress

Conversation

@mikkokotila

Copy link
Copy Markdown
Contributor

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

  • Changes have gone through actual use testing

@mikkokotila
mikkokotila merged commit 241781c into codex/finance-sources Oct 2, 2026
6 checks passed
@mikkokotila
mikkokotila deleted the codex/hyperliquid-egress branch October 2, 2026 09:29
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.

1 participant