Archived
Collects the order books of Polymarket's 20 busiest markets (40 symbols) into the template's SBE format: a Delta per level change, plus Snapshots on subscribe, every minute, and whenever a fresh book corrects ours. Every change is checked against Polymarket's own book hash; a failed check resyncs the symbol on the open socket, and the log counts losses apart from the few ms our own resync hides. Runs until SIGINT, which closes the socket and flushes the output; reconnects when the server drops it. A `reconcile` binary checks an output file against itself.
28 lines
839 B
TOML
28 lines
839 B
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"
|
|
chrono = "0.4"
|
|
crossbeam = "0.8.4"
|
|
ctrlc = "3"
|
|
# Not used directly: tungstenite leaves rustls's crypto provider to the app, and
|
|
# rustls panics at runtime unless exactly one (here ring) is enabled.
|
|
rustls = { version = "0.23", default-features = false, features = ["ring"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
sha1 = "0.11"
|
|
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"
|