feat: ready to submit, a run to watch, the README, the review's fixes

Sprint 08 (roadmap/08. ready to submit.md), the last milestone.

- scripts/watch.sh runs the collector with a live view of its log, stops
  cleanly on Ctrl-C, then checks the output (reconcile) and shows one
  symbol's book as text (show, a new binary).
- The README for the solution, with the final runs: Polymarket through an
  outage it recovered from on its own, Kalshi's demo with two slow
  connections recycled.
- From a review of the whole codebase: Kalshi takes RSA keys too
  (RSA-PSS-SHA256); a slow Kalshi connection takes the hourly recycle's
  next turn, which it nearly never got before; a market tracked again no
  longer fails reconcile; Book::add checks for overflow; usage and --help
  name the key variables; the first scan says how far it got.
- Tests for every gap the reviews found, an offline run of the whole
  orchestrator among them; ShellCheck in CI.
This commit is contained in:
pascal committed 2026-11-12 22:32:39 +01:00
1 parent 515e85941d
commit cf6c16c9cf
35 files changed
+2791 -207

No files matched your search

+8 -3
View File
@@ -237,9 +237,14 @@ is the demo's.
`api.elections.kalshi.com` and `demo-api.kalshi.co` still answer.
- **Auth:** the websocket handshake carries `KALSHI-ACCESS-KEY` (the key id),
`KALSHI-ACCESS-TIMESTAMP` (ms) and `KALSHI-ACCESS-SIGNATURE`: base64 of the
Ed25519 signature of `<timestamp>GET/trade-api/ws/v2`. Without them: 401.
The market listing needs no key. Keys are created per environment
(Account → Profile → API Keys); the private key is a PKCS#8 PEM shown once.
signature of `<timestamp>GET/trade-api/ws/v2`. Without them: 401. The
key is Ed25519 (RFC 8032 over that text) or 2048-bit RSA (RSA-PSS,
SHA-256, MGF1 SHA-256, a salt of the digest's length); Kalshi picks the
check from the public key it holds, and a PEM's header doesn't say which
(an RSA key may be PKCS#1, as Kalshi gives it, or PKCS#8; Kalshi's API
keys page, read 2026-11-12). The market listing needs no key. Keys are
created per environment (Account → Profile → API Keys); the private key
is shown once.
- **Subscribe:** `{"id":1,"cmd":"subscribe","params":{"channels":
["orderbook_delta"],"market_tickers":[...]}}` is answered
`{"type":"subscribed","id":1,"msg":{"channel":"orderbook_delta","sid":1}}`,