Repository navigation
Add OiFundingInterval::OneMinute, and a cursor for order flow - #13
Merged
Merged
Conversation
The API now serves 1-minute buckets on funding, open interest and HIP-3 breadth history, the three params typed with OiFundingInterval, but the enum had no variant for them. - OiFundingInterval::OneMinute maps to "1m". The enum is not non_exhaustive, so a match without a wildcard arm needs the new arm; the changelog says so. - The breadth history doc lists 1m. - OrderFlowParams::interval and Hip4OrderFlowParams::interval document the buckets the API serves: "1m" (the default), "5m", "15m" and "1h". - Tests: every variant maps to its wire value, and OneMinute is sent as interval=1m by funding, open interest and HIP-3 breadth history.
The API now pages order flow on Hyperliquid, HIP-3 and HIP-4: a page holds the oldest `limit` buckets of the window, and `next_cursor` is set while more may follow. `OrderFlowParams` and `Hip4OrderFlowParams` had no `cursor`, so a caller could never get past the first page. - `cursor: Option<String>` on both structs, sent by `orders.flow()` and `hip4.get_order_flow()`. Requests without it are unchanged. - Field and method docs: start inclusive, end exclusive, limit counts buckets (default 1000, max 10000), buckets are labelled by open time in UTC, and how to follow `next_cursor`. - The README order-flow example pages a day at 1m. - New test (wiremock): the cursor is sent on core, HIP-3 and HIP-4, the first page carries none, and `next_cursor` comes back. It fails when the cursor is not sent. - CHANGELOG: both structs are built with struct literals, so a literal that lists every field needs `cursor: None` (or `..Default::default()`).
The API reads a sent order-flow cursor, but it does not return next_cursor on order flow yet. That arrives with an API switch. Until then the docs must not tell callers to page by it. - `cursor` stays on `OrderFlowParams` and `Hip4OrderFlowParams`. Its doc describes a resume point (a Unix millisecond timestamp); `limit` is the maximum number of buckets. The struct and method docs no longer say how to follow next_cursor. - The README order-flow example is a single request again. - CHANGELOG: order-flow next_cursor arrives with an API switch.
0xFantomMenace
added a commit
that referenced
this pull request
Sep 29, 2026
Add OiFundingInterval::OneMinute, and a cursor for order flow
0xFantomMenace
added a commit
that referenced
this pull request
Sep 29, 2026
Add OiFundingInterval::OneMinute, and a cursor for order flow
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.
The 0xArchive API now serves 1-minute buckets (
interval=1m) on funding, open interest, price, liquidation-volume and breadth history, on every venue. Order flow now honors its bucket parameter, with1m(default),5m,15mand1h, and reads a sentcursor.In this crate, funding, open interest and HIP-3 breadth history type
intervalasOiFundingInterval, which had no 1-minute variant. Liquidation volume, prices and order flow take aStringand already pass"1m"through.OrderFlowParamsandHip4OrderFlowParamshad nocursor.The API does not return
next_cursoron order flow yet. That arrives with an API switch, after SDK releases that forward the cursor are published. So this PR addscursorbut does not document paging bynext_cursor; the paging docs are in draft #14, held until the switch is on.Changes
OiFundingInterval::OneMinute("1m").1m.OrderFlowParams::intervalandHip4OrderFlowParams::intervaldocument the buckets the API serves.cursor: Option<String>onOrderFlowParamsandHip4OrderFlowParams, sent byorders.flow()(core and HIP-3) andhip4.get_order_flow(): a resume point in Unix milliseconds, and the response starts at the first bucket that opens after it. The field and method docs saystartis inclusive,endexclusive,limitis the maximum number of buckets (default 1000, max 10000), a response holds the oldestlimitbuckets, and buckets are labelled by open time in UTC. The README order-flow example is a single request.OiFundingIntervalvariant maps to its wire value;OneMinuteis sent asinterval=1mby funding, open interest and HIP-3 breadth history (wiremock, one expected hit per route).next_cursorin the response is surfaced. It fails when the cursor is not sent.next_cursorarrives with an API switch.Semver note
OiFundingIntervalis not#[non_exhaustive], so downstream code that matches it without a wildcard arm will need aOneMinutearm. The order-flow param structs gain a public field, so a struct literal that lists every field needscursor: None(or..Default::default()). The changelog says both; pick the version bump accordingly at release.Test plan
cargo test --all-targets: pass (coverage_contract 16 of 16, including the 3 new tests).cargo test --doc: 8 passed.cargo fmt --checkreports no diffs in the lines this PR changes. The crate has existing rustfmt drift elsewhere, left alone here.interval=1mand15mon order flow return 1-minute and 15-minute buckets, a sentcursorstarts the response after it, and the response carries nonext_cursor.