Repository navigation
Accept 1-minute aggregation buckets, and type the order flow cursor - #13
Merged
Merged
Conversation
The API now serves 1-minute buckets on funding, open interest, price, liquidation-volume and breadth history. OiFundingInterval types the interval on all of those params, so a TypeScript caller could not pass '1m' without a cast. - OiFundingInterval includes '1m'; the liquidation-volume comment and the README interval lists follow. - OrderFlowParams.interval documents the buckets the API serves: '1m' (the default), '5m', '15m' and '1h'. - A test sends interval '1m', typed as OiFundingInterval, through funding, open interest, liquidation volume and HIP-3 breadth, and checks each request carries it.
The API now pages order flow on Hyperliquid, HIP-3 and HIP-4: a page holds the oldest `limit` buckets of the window, and `nextCursor` is set while more may follow. `OrderFlowParams` had no `cursor`, so TypeScript callers could not follow it without a cast. `orders.flow()` and `hip4.getOrderFlow()` already send the params they are given, so there is no runtime change. - `OrderFlowParams.cursor` (`number | string`), with docs for it and for `limit` as buckets per page (default 1000, max 10000). - `flow()` JSDoc says how buckets are labelled and how to page. - The README order-flow example follows `nextCursor` with the same start, end and interval. - New test: the cursor reaches the request on core, HIP-3 and HIP-4 and `nextCursor` comes back. The test does not typecheck against the old `OrderFlowParams`.
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. - `OrderFlowParams.cursor` stays. Its JSDoc describes it as a resume point (a Unix millisecond timestamp); `limit` is the maximum number of buckets, oldest first. - The `flow()` JSDoc no longer says how to follow nextCursor. - The README order-flow example is a single request again. - CHANGELOG: order-flow nextCursor arrives with an API switch.
0xFantomMenace
added a commit
that referenced
this pull request
Sep 29, 2026
Accept 1-minute aggregation buckets, and type the order flow cursor
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.OiFundingIntervaltypesintervalon all of those params, so TypeScript callers could not pass'1m'without a cast. There is no runtime validation to change.OrderFlowParamshad nocursor, so sending one needed a cast. The methods already send the params they are given, so this is a type and docs change.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 typescursorbut does not document paging bynextCursor; the paging docs are in draft #14, held until the switch is on.Changes
OiFundingIntervaladds'1m'.FundingHistoryParams,OpenInterestHistoryParams,LiquidationVolumeParams,PriceHistoryParamsand the HIP-3 breadth history params pick it up.LiquidationVolumeParams.intervalcomment and the README interval lists include1m.OrderFlowParams.intervalis documented with the buckets the API serves; the README order-flow example says the same.OrderFlowParams.cursor(number | string): a resume point in Unix milliseconds; the response starts at the first bucket that opens after it.limitis documented as the maximum number of buckets, oldest first (default 1000, max 10000). Theflow()JSDoc says how buckets are labelled. This coversorders.flow()on core and HIP-3 andhip4.getOrderFlow().interval: '1m'typed asOiFundingIntervalgoes through funding, open interest, liquidation volume and HIP-3 breadth, and every request carries it.nextCursorin the response is surfaced.nextCursorarrives with an API switch. No version bump.Test plan
vitest run: 73 passed.tsc --noEmit: clean. Both new tests also typecheck under the project config; the interval test fails to compile against the old union, and the order-flow test against the oldOrderFlowParams.eslint src/: 0 errors, 36 warnings. This change only edits a type union, a type field and comments insrc/.interval=1mand15mon order flow return 1-minute and 15-minute buckets, a sentcursorstarts the response after it, and the response carries nonext_cursor.