Repository navigation
Accept --interval 1m on aggregated history, and page order flow with --cursor - #5
Merged
Merged
Conversation
…kets The API now serves 1-minute buckets on funding, open interest, price, liquidation-volume and breadth history. The CLI validated the aggregation interval against 5m to 1d, so funding, oi and prices refused 1m before sending. - validateInterval accepts 1m, and the help and README list it. - Published SDK releases leave 1m out of OiFundingInterval, although the SDK sends the value unchanged. toSdkInterval() converts a validated interval at the three call sites; drop it once the dependency is on an SDK release that includes 1m. - orders flow help and README list the bucket widths the API serves (1m, 5m, 15m, 1h), not 30m, 4h and 1d, which it refuses. - New tests: every served interval passes validation, and 2h, 1w, 1s and an empty value exit before a request.
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. `oxa orders flow` and `oxa hip4 orders flow` printed `nextCursor` but had no `--cursor` to follow it. - `--cursor` on both commands, sent with the request. Commands without it are unchanged. - `--limit` help says it counts buckets (default 1000, max 10000). - With `--out`, the summary reports `has_more` and `nextCursor`, and pretty output says when more data is available, as order history does. - README: the `--cursor` row and how to page. - New test: the cursor is sent on the core and HIP-4 commands and the next cursor is printed. It fails 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 help and README must not tell users to page by it, and the --out summary must not report has_more: false while more buckets exist. - `--cursor` stays on `oxa orders flow` and `oxa hip4 orders flow`, described as a resume point in Unix ms. `--limit` is the maximum number of buckets, oldest first. - The --out summary's has_more and nextCursor, the pretty "Has more" field and the "use --cursor to paginate" hint are held back. The output envelope keeps its nextCursor, as before. - README: no paging paragraph. - CHANGELOG: order-flow nextCursor arrives with an API switch.
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 buckets at1m,5m,15mor1h, and reads a sentcursor.validateIntervalonly allowed5mto1d, sooxa funding history,oxa oi historyandoxa prices(and their HIP-4 forms) exited with a validation error on--interval 1mbefore sending anything.oxa orders flowandoxa hip4 orders flowhad no--cursor.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 adds--cursorbut does not document paging bynextCursor; the paging help and--outsummary fields are in draft #6, held until the switch is on.Changes
validateIntervalaccepts1m; the--intervalhelp on those commands,oxa liquidations volume, and the README tables list it.oxa orders flowandoxa hip4 orders flow: the help and README now list1m,5m,15m,1h. They used to list30m,4hand1d, which the API refuses. The CLI default stays1h.intervalasOiFundingInterval, which does not include'1m'yet (a matching change is open in the TypeScript SDK). The SDK sends the value unchanged, sotoSdkInterval()converts a validated interval at the three call sites. It can be removed once the dependency moves to an SDK release whoseOiFundingIntervalincludes'1m'.oxa orders flowandoxa hip4 orders flowtake--cursorand send it: a resume point in Unix ms, and the API starts the response at the first bucket that opens after it. Commands without it are unchanged.--limithelp says it is the maximum number of buckets, oldest first (default 1000, max 10000). The README documents--cursorand says how buckets are labelled.tests/order-flow.test.ts: the cursor is sent on the core and HIP-4 commands and anextCursorin the response is printed in the envelope; it fails without the change.tests/intervals.test.ts: every served interval passes validation;2h,1w,1sand an empty value exit before a request.nextCursorarrives with an API switch. No version bump.Test plan
tsc --noEmit: clean.vitest run: 73 passed (5 files).interval=1mand15mon order flow return 1-minute and 15-minute buckets, a sentcursorstarts the response after it, and the response carries nonext_cursor.