feat!: a generic core, and Kalshi through it

The orchestrator, the connection loop and the book thread's shell move to
src/core/, generic over an Exchange and its loss rule (ADR 0004).
Polymarket runs through it unchanged. Kalshi joins: a signed handshake
(KALSHI_KEY_ID_FILE, KALSHI_PRIVATE_KEY_FILE), a reconnect on a skipped
sequence number, first one wins by clock and rank, and its market listing
with markets tracked from three hours before they open.

Breaking: the exchange is now the first argument,
`engineering-challenge <polymarket|kalshi|kalshi-demo> [OUTPUT]`.
This commit is contained in:
pascal committed 2026-11-11 20:54:17 +00:00
1 parent 480ee3ad2d
commit 1a5bbcd602
33 files changed
+8150 -1846

No files matched your search

+6
View File
@@ -8,13 +8,19 @@ default-run = "engineering-challenge"
[dependencies]
anyhow = "1"
# Kalshi's handshake signature.
base64 = "0.23"
chrono = "0.4"
crossbeam = "0.8.4"
# `termination`: SIGTERM and SIGHUP stop the collector like SIGINT.
ctrlc = { version = "3", features = ["termination"] }
# Not used directly: tungstenite leaves rustls's crypto provider to the app, and
# rustls panics at runtime unless exactly one (here ring) is enabled.
# Signs Kalshi's handshake (Ed25519); already rustls's crypto provider.
ring = "0.17"
rustls = { version = "0.23", default-features = false, features = ["ring"] }
# Reads the PEM of Kalshi's key.
rustls-pki-types = { version = "1", features = ["std"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha1 = "0.11"