Getting Started
Set up OpenQuant-rs for local research and production-facing validation.
Requirements
- Rust toolchain: stable channel (`rustup default stable`)
- Python 3 (for benchmark snapshot scripts)
- GitHub Actions for release/docs automation (optional for local dev)
Clone and Validate
git clone https://github.com/Open-Quant/openquant.git
cd openquant-rs
# Fast test pass used by CI
cargo test --workspace --lib --tests --all-features -- --skip test_sadf_test
# Run long path explicitly
cargo test -p openquant --test structural_breaks test_sadf_test -- --ignored Project Layout
| Path | Purpose |
|---|---|
crates/openquant/src/ | Main library modules. |
crates/openquant/tests/ | Module-level Rust behavior and regression tests. |
tests/fixtures/ | Shared deterministic fixtures. |
benchmarks/ | Benchmark baseline/latest snapshots and manifest. |
docs/ | Release status, benchmark, and productionization notes. |
First Quant Workflow
use openquant::risk_metrics::RiskMetrics;
let returns = vec![-0.02, 0.01, 0.015, -0.01, 0.005];
let var_95 = RiskMetrics::calculate_value_at_risk(&returns, 0.05)?;
let es_95 = RiskMetrics::calculate_expected_shortfall(&returns, 0.05)?;
println!("VaR 95%: {var_95:.6}, ES 95%: {es_95:.6}"); Benchmark Workflow
cargo bench -p openquant --bench perf_hotspots --bench synthetic_ticker_pipeline
python3 scripts/collect_bench_results.py --criterion-dir target/criterion --out benchmarks/latest_benchmarks.json --allow-list benchmarks/benchmark_manifest.json
python3 scripts/check_bench_thresholds.py --baseline benchmarks/baseline_benchmarks.json --latest benchmarks/latest_benchmarks.json --max-regression-pct 25