aggr-binaries indexes large trade archives and builds deterministic, resumable candle binaries.
Core commands:
index: inventory raw files into SQLiteprocess: generate gap-aware binaries + companionsregistry: rebuild derived registry rows from companionsfixgaps: recover missing trades from persisted gap rows and patch outputsclear: delete one market's outputs/state and reindex only that market
Core design constraints:
- determinism (
same input => same output) - resumability (resume from output state)
- scalability (millions of files)
Task docs hold detailed behavior and contracts:
- Node.js
>= 22 sortinPATH(fixgaps rewrite flow)unzipinPATH(Kraken direct archive extraction)
Install:
npm installCreate config.json (or copy config.example.json) and set:
rootdbPathbatchSizeflushIntervalSecondsincludePathsoutDirtimeframe
All values can be overridden via CLI flags.
npm start -- index
npm start -- process
npm start -- registrySelective run example:
npm start -- process --collector RAM --exchange BITMEX --symbol SOLUSD --timeframe 1mindex: docs/index.mdprocess: docs/process.mdregistry: docs/registry.mdfixgaps: docs/fixgaps.mdclear: docs/index.md (Clear workflow)
Shared flags:
-r, --root <path>-d, --db <path>--config <path>--no-config--include <path>(repeatable)
Input path layout:
{collector}/{bucket}/{exchange}/{symbol}/{YYYY-MM-DD[-HH][.gz]}
Trade line format:
{ts_ms} {price} {size} {side(1=buy)} {liquidation?}
Output per market/timeframe:
{outDir}/{collector}/{exchange}/{symbol}/{timeframe}.bin
{outDir}/{collector}/{exchange}/{symbol}/{timeframe}.json
Binary layout and companion contract are documented in docs/process.md.
- Full app:
npm run serve - Client dev:
npm run dev:client
Main UI routes:
/timeline/viewer
- DB schema policy is fresh-schema-only; incompatible schemas fail fast with rebuild guidance.
- SQLite write contention (
SQLITE_BUSY/SQLITE_LOCKED) is retried with bounded backoff. - If registry diverges from existing outputs after interruption, run
registryfor the affected scope.
npm run build:core
npm run build:client
npm run build:tests
npm test