Repository navigation
Accept 1-minute breadth buckets, and page order flow with a cursor - #13
Merged
Merged
Conversation
The API now serves 1-minute buckets on breadth, open interest, funding, price and liquidation-volume history. Breadth is the one method here that checks interval before sending, so it refused 1m with a ValueError. - BreadthInterval and BREADTH_INTERVALS include 1m. The test that used 1m as its refused example now uses 2h, and the accepted list covers 1m. - Funding and open interest docstrings, and the README interval lists, include 1m. - The order-flow docstring suggested 4h and 1d, which the API refuses. It now lists 1m (the default), 5m, 15m and 1h.
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. `orders.flow()` and `aflow()` had no `cursor` parameter, and a `cursor` keyword fell into `**kwargs` and was dropped, so every call returned the first page. - `flow()` and `aflow()` take `cursor` and send it. Requests without it are unchanged. - The docstring says how buckets are labelled and how to page, and that `limit` counts buckets (default 1000, max 10000). - The README order-flow example pages a day at 1m until `next_cursor` is None. - Tests: the cursor is sent on core, HIP-3 and HIP-4, sync and async, and `next_cursor` comes back. Both fail without the change.
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. - `flow()` keeps its `cursor` parameter. The docstring describes it as a resume point (a Unix millisecond timestamp) and no longer says how to follow next_cursor; `limit` is the maximum number of buckets. - 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
Accept 1-minute breadth buckets, and send a cursor on order flow
0xFantomMenace
added a commit
that referenced
this pull request
Sep 29, 2026
Accept 1-minute breadth buckets, and send a cursor on 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 breadth, open interest, funding, price and liquidation-volume history, on every venue. Order flow now honors its bucket parameter, with1m(default),5m,15mand1h, and reads a sentcursor.Most methods here pass
intervalstraight through, so they already work. HIP-3 breadth is the exception: it validatesintervalbefore sending and raisedValueErroron1m.Order flow had no
cursorparameter. Acursorkeyword fell into**kwargsand was dropped.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
BreadthIntervalandBREADTH_INTERVALSinclude"1m".test_coverage_contract.py: the refused-interval example was1m; it is now2h, which the API still refuses. The accepted-interval parametrisation includes1m.1m.4hand1d, which the API refuses. It now lists1m(default),5m,15m,1h, says buckets are labelled by open time in UTC with empty ones omitted, that a response holds the oldestlimitbuckets (default 1000, max 10000), thatstartis inclusive andendexclusive. The README order-flow example notes the same values.orders.flow()andaflow()takecursorand send it (Hyperliquid, HIP-3 and HIP-4): a resume point in Unix milliseconds, and the response starts at the first bucket that opens after it. Requests without it are unchanged.next_cursorin the response is surfaced. Both fail without the change.next_cursorarrives with an API switch. No version bump.Test plan
pytest: 97 passed (95 plus the 2 order-flow cursor tests).ruff checkon the changed files: clean.interval=1mand15mon order flow return 1-minute and 15-minute buckets, a sentcursorstarts the response after it, and the response carries nonext_cursor.