Archived
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.
16 lines
506 B
Bash
Executable File
16 lines
506 B
Bash
Executable File
#!/bin/sh
|
|
# The single CI entry point; run it before every commit.
|
|
# One check per line: `set -e` doesn't apply on the left of `&&` / `||`, so
|
|
# chaining would let a failing check pass silently.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
|
|
cargo fmt --check
|
|
cargo clippy --all-targets -- -D warnings
|
|
cargo test
|
|
|
|
# The latency analysis (scripts/latency/): ruff pinned, run through uvx.
|
|
uvx ruff@0.15.0 format --check scripts/latency
|
|
uvx ruff@0.15.0 check scripts/latency
|
|
python3 -m unittest discover -s scripts/latency
|