Skip to content

Repository files navigation

Vivaldi Trade Master

Vivaldi Trade Master

⚠ WORK IN PROGRESS — actively evolving; APIs, examples, and the bundled binaries change between revisions. Things might or might not work, for now.

work in progress runnable locked rust paganini quoters margin ci

A risk-first market-making engine + OMS, with a Bloomberg-style front office.
The example strategies reproduce published quant research — regime-aware optimal quoting (HMM+HJB), deep hedging under frictions, ML/regime intraday trading — re-implemented from scratch in a home-grown Rust quant library (Paganini), wired through one risk gate, runnable in 30 seconds. See RESEARCH.md.

Vivaldi Trade Master desk — N2 front office
The N2 desktop front office: candles + SMA + volume, equity curve, positions, greeks & options chain, Markets watchlist, System feed health, and the 📰 News monitor.


A self-contained, source-free demo of the Vivaldi Trade Master and OMS, with the N2 front-office GUI. This repo holds the demo only — runnable binaries, strategy and config examples, OMS FIX client examples, screenshots, and a website. It NEVER holds the engine/GUI source or any non-demo binary (enforced by ./ci.sh).

What the demo binaries are (and are not)

Every binary here is built with Vivaldi's profile-demo — a compile-time lockdown:

  • Local mirage only. No testnet, no live venue, no external network. The feed is the bundled emulator.
  • +1 ms artificial latency on the order/quote path (so the System monitor shows a realistic, honest latency).
  • 3-minute runtime freeze. After 3 minutes of a single run the engine goes read-only (new orders/quotes refused; the GUI keeps rendering an EXPIRED — DEMO banner). Monotonic clock — a clock setback can't extend it.
  • 6-month build expiry. The build date is stamped in at compile time; 6 months later the binary refuses to start (BUILD EXPIRED — rebuild). Fail-closed clock.

These are unbypassable at runtime — there is no env var, config, or API that lifts them.

Layout

dist/                 binaries per target (filled by Vivaldi's build-demo-dist.sh)
strategies/           .aria strategy artifacts + example strategy configs
configs/              SPAN / SIMM / portfolio-opt / Paganini example configs
oms-fix-clients/      real FIX-engine client examples — go / python / cpp / rust (SOURCE, as examples)
screenshots/          captured GUI panels, CLI outputs, FIX sessions (+ captions)
site/                 index.html (1-pager) + book/ (mdBook)
site/diagrams/        architecture diagrams — Mermaid sources → SVG/PNG
site/slides/          interview slide deck — reveal.js + Marp/Markdown source (→ PDF/PPTX)
RESEARCH.md           each example mapped to the published research it reproduces
SPAN-SIMM-METHODOLOGY.md  the exact margin methodologies + every simplification, named
MANUAL.md             copy-pasteable manual test steps, one section per build phase
ci.sh                 guard: no engine/GUI source, demo-profile binaries only

Quick start

./dist/<your-target>/run-demo.sh      # launches the GUI on mirage (demo profile)

Targets: linux-arm64 (cpu), linux-amd64 (cpu), mac-arm64 (gpu/Metal), linux-amd64-cuda (cuda — verified on an NVIDIA RTX PRO 6000 / CUDA 12.9).

GPU (the linux-amd64-cuda target)

The CUDA build adds real GPU compute through the home-grown Paganini-GPU kernels (cudarc/NVRTC) and the gpu-backtest CUDA scenario VM, all behind a cuda cargo feature — every path falls back to CPU when no device is present (the binary has no hard CUDA link, so it still runs on a plain box). run-demo.sh exercises all three:

./dist/linux-amd64-cuda/bin/vivaldi gpu-probe            # matmul on CUDA vs CPU + parity check
./dist/linux-amd64-cuda/bin/vivaldi portfolio-opt --universe 4096   # QUBO field step (J·x) on the GPU
./dist/linux-amd64-cuda/bin/vivaldi gpu-sweep --scenarios 512       # N backtests in parallel on the CUDA VM

(The bundled bin/gpu/libbt_gpu_cuda.so is the scenario-VM library; run-demo.sh puts it on LD_LIBRARY_PATH. Apple-Silicon Metal acceleration of the same paths is wired but deferred — see the Vivaldi TODO.)

Reproducing published research

The reason to look twice: the example strategies aren't toys — each reproduces a piece of published quant research, re-implemented from scratch in the home-grown Paganini Rust quant library and run through the same tick → strategy → RISK → fill loop as production. One command runs them all and prints each one's lineage:

./dist/<target>/bin/vivaldi gallery
example strategy reproduces the idea
regime_aware_quoter regime-aware-optimal-quoting HMM + HJB regime-switching market making (extends Avellaneda–Stoikov); Paganini ships the Gaussian HMM, the quadratic-ansatz HJB solver, and the online belief filter

The Paganini optimal quoters run live, side by side, against one tape — including the HMM + HJB regime quoter (vivaldi paper --strategy regime), which ends the flattest of all four (strongest inventory control):

./configs/paganini-compare.sh      # fixed vs Avellaneda–Stoikov vs GLFT vs regime (HMM+HJB)

On a single tape the trivial fixed maker shows the highest PnL — but that's a trap: it ends pinned at the position limit, so its PnL is just which way the price drifted. Run the same quoters across many tapes and read the risk, not the mean — the regime quoter's PnL stdev is ~100× lower and its inventory ~100× lower (it's a market maker, not a directional bet):

./configs/paganini-robustness.sh   # PnL stdev + inventory across 8 tapes — regime wins by ~100×

Full algorithm/parameter/result write-up per example: RESEARCH.md. Margin methodology with exact version references: SPAN-SIMM-METHODOLOGY.md.

License

The example code here — strategies/, configs/, oms-fix-clients/, the *.sh scripts, the site/ sources, and the Markdown docs — is CC0 (see LICENSE-EXAMPLES) — copy it freely. The Vivaldi Trade Master engine, OMS, N2 GUI, and the Paganini quant library are proprietary and governed by their own license; this repo is a source-free demo that only drives their published binary surface (the profile-demo-locked binaries under dist/).

About

Demo of the very much WIP version of the Trade Master

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages