Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

# The CLI depends on the @0xarchive/sdk release named in package.json. A
# CLI release can land in this repo before that SDK version reaches npm.
# In that window this step installs the newest published SDK for this run
# only and restores package.json afterwards. The CLI type-checks against
# either (it reads the newer SDK resources through its own interfaces),
# and the tests stub the SDK surface these commands call. Once the floor
# version is on npm, the first branch runs and nothing is substituted.
- name: Install dependencies
run: |
floor="$(node -p "require('./package.json').dependencies['@0xarchive/sdk']")"
if npm view "@0xarchive/sdk@${floor}" version > /dev/null 2>&1; then
npm install --no-audit --no-fund
else
latest="$(npm view @0xarchive/sdk version)"
echo "::warning::@0xarchive/sdk ${floor} is not published yet; installing ${latest} for this run only."
npm pkg set "dependencies.@0xarchive/sdk=${latest}"
npm install --no-audit --no-fund
git checkout -- package.json
fi
npm ls @0xarchive/sdk || true

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Package contents
run: npm run check:pack
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Changelog

## Unreleased
## 1.10.0 - 2026-09-28

### Added

- Lighter on Robinhood Chain, the second Lighter deployment, as `--exchange rh-lighter` on every shared market-data command that Lighter mainnet supports: instruments, order book and order book history, trades (canonical range and preliminary recent tier), candles, funding, open interest, liquidations, prices, summary, freshness, and `auth test`. It is USDG-quoted with 84 markets (57 perp, 27 spot); perps are uppercase (`BTC`) and spot markets are dashed (`AAPL-USDG`). Trades and liquidations are served from 2026-06-26 20:10:26 UTC, the venue's first trade; order book, open interest, and funding from 2026-08-22 18:43 UTC; candles from 2026-06-26 once they are enabled for this deployment. It has no L3.
- Live Robinhood Chain streams: `oxa stream orderbook <symbol> --exchange rh-lighter` and `oxa stream trades <symbol> --exchange rh-lighter`, and `oxa stream subscribe` accepts `rh_lighter_orderbook`, `rh_lighter_trades`, `rh_lighter_open_interest`, and `rh_lighter_funding`. Messages have the same shapes as the `lighter_*` live channels, `--interval-ms` (100 to 5000) works on `rh_lighter_orderbook`, and drop notices on `rh_lighter_*` channels are warnings, as on Lighter mainnet. They are served on `wss://api.0xarchive.io/ws`, the CLI default. `rh_lighter_candles` is replay-only and is rejected before a socket opens.
- Account positions, `oxa positions ...`, on `hyperliquid`, `hip3`, `lighter`, and `rh-lighter`: `get` (latest snapshot, or as of `--timestamp`), `history` (hourly snapshots), `changes` (the change log), `market` (every open position in one market, with `--side`, `--min-value`, and `--include-system` on Lighter), `summary` (long/short positioning now or hourly), and `all` (every open position at one hour). Hyperliquid and HIP-3 add `account` and `account-history`. Hyperliquid and HIP-3 are keyed by `--address`; Lighter by `--account <index>`. JSON output includes the response `meta` (as-of time, snapshot, source, quality, staleness, and finalization fields).
- `oxa accounts by-l1 --l1-address 0x...` lists the Lighter mainnet account indices owned by an L1 address.
- `--cursor` on `oxa orders flow` and `oxa hip4 orders flow`: a resume point in Unix ms, and the API starts the response at the first bucket that opens after it. The API does not return `nextCursor` on order flow yet: it arrives with an API switch, and until then `nextCursor` in the order-flow output is `null`.
- A package-contents check (`npm run check:pack`) and a CI workflow that runs the typecheck, tests, build, and that check.

### Changed

- `oxa liquidations history` and `oxa liquidations volume` accept `--exchange lighter` and `--exchange rh-lighter`; they were previously refused. Lighter rows keep the trade's raw fields (`liquidationType`, `usdAmount`, both accounts, `rawJson`); Robinhood Chain rows from before live capture (2026-08-22) were backfilled from the venue's finalized export and carry `source` `bucket` with an empty `rawJson`. Lighter volume buckets carry a total and a count with no long/short split. `oxa liquidations user` stays Hyperliquid only.
- On Lighter ranges (both deployments), `oxa trades fetch` passes the response `meta` through, including the finalization fields (`meta.finalizedThrough`, and `meta.clampedTo` when the range was clamped to the watermark). Hyperliquid and HIP-3 trades output is unchanged.
- `oxa orders ...`, `oxa l4 ...`, and `oxa l2 ...` reject `--exchange lighter` and `--exchange rh-lighter` with a clear message before any request, instead of failing inside the command.
- `--interval 1m` works on `oxa funding history`, `oxa oi history`, `oxa prices`, `oxa liquidations volume`, and the HIP-4 open interest and price commands. The API now serves 1-minute buckets on those routes. Funding, open interest, and prices used to refuse `1m` before sending the request.
- `oxa orders flow` and `oxa hip4 orders flow` describe `--interval` as the bucket widths the API serves: `1m`, `5m`, `15m`, `1h` (default `1h`). The help used to list `30m`, `4h`, and `1d`, which the API refuses.
- The HIP-4 funding and liquidations refusals now list every exchange that serves those routes.
- Requires `@0xarchive/sdk` 1.12.0 or newer, the release with the Robinhood Chain client, the positions resources, and Lighter liquidations.

## 1.9.0 - 2026-09-25

Expand Down
Loading
Loading