This repository has been archived on 2026-11-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
orderbook-collector/Cargo.toml
T
pascal 515e85941d feat(latency): latency experiments, LATENCY.md, Kalshi's slow-connection recycle
Extension 4. `engineering-challenge latency EXCHANGE OUT.csv` opens 16
connections to the same busy markets and writes every copy of every change;
`scripts/latency/analyse.py` gives each connection's speed, whether it
persists, what keeping the fastest would gain, lateness by address, and lag
with the clock's offset. LATENCY.md writes up four runs: on Polymarket speed
persists but is worth under a millisecond, at the median only; on Kalshi's
demo keeping the fastest pair lowers p99 by 28% and 42%, the threshold
agreed before the runs.

So the collector now recycles a Kalshi connection whose mean lateness stays,
3 minutes running, in the slowest quarter and above twice everyone's, ahead
of its hourly turn. Kalshi's rule measures each duplicate's lateness; the
orchestrator judges once a minute. A duplicate's lag in Polymarket's minute
line is now its "lateness".

Roadmap milestone 7, roadmap/07.
2026-11-12 15:05:25 +01:00

37 lines
1.2 KiB
TOML

[package]
name = "engineering-challenge"
version = "0.1.0"
edition = "2024"
build = "src/util/build.rs"
# `cargo run` runs the collector, not `src/bin/reconcile.rs`.
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"
sntpc = { version = "0.11", features = ["sync", "std"] }
sntpc-net-std = "1.3"
tungstenite = { version = "0.30", features = ["rustls-tls-webpki-roots"] }
ureq = "3"
[build-dependencies]
ergo-sbe = "=0.1.16"
indexmap = { version = "2", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
serde_yaml_ng = "0.9"