A small Rust CLI for comparing Binance USD-M network latency from different machines or cloud locations.
The probe is intentionally narrow:
- Exchange: Binance USD-M Futures
- Symbol:
BTCUSDT - WebSocket:
btcusdt@bookTicker - Signed REST probe:
POST /fapi/v1/order/test - Output percentiles:
p50_us,p95_us, andp99_us
It never places a real order and does not contain strategy logic.
time_sync_rtt:GET /fapi/v1/timeround-trip, including response decoding. The samples calibrate the local clock against Binance.book_ticker: Binance event time to local receipt time, adjusted by the calibrated clock offset.order_test: local request preparation, parameter serialization, HMAC signing, HTTP round-trip, and response handling forPOST /fapi/v1/order/test.
All summaries use microseconds. Binance WebSocket event timestamps and signed-request timestamps remain millisecond-based, so microsecond output provides consistent arithmetic and aggregation, not microsecond source timestamp accuracy.
Public market-data mode does not require credentials:
cargo run --release -- --duration-secs 95 --disable-order-testTo include the signed order-test probe:
export BINANCE_API_KEY=...
export BINANCE_API_SECRET=...
cargo run --release -- --duration-secs 95The default duration is 95 seconds and includes 30 initial server-time samples. Keep only final summaries with:
RUST_LOG='summary=info,crypto_latency_probe=warn' \
cargo run --release -- --duration-secs 95 --disable-order-testBuild the image:
docker build -t crypto-latency-probe .Run without Binance credentials:
docker run --rm crypto-latency-probe \
--duration-secs 95 \
--disable-order-testRun all probes with a local .env file:
docker run --rm --env-file .env crypto-latency-probe \
--duration-secs 95For a Linux amd64 image on an arm64 development machine:
docker buildx build --platform linux/amd64 --load \
-t crypto-latency-probe:linux-amd64 .An anonymized two-location comparison is included to show the output and comparison method without publishing server identifiers.
cargo fmt --check
cargo test --locked
cargo clippy --locked --all-targets -- -D warnings
cargo build --release --lockedRequires Rust 1.85 or newer.
LGPL-3.0-or-later.