Skip to content
Docs Architecture
Tech

Architecture

Pure engines, one adapter seam, two backends: how the code is organised.

Layers

FolderContents
src/quantPure engines with no React and no network: grid, funding, shield, whale radar, L3, regime, backtest, backfill
src/simIn-memory matching engine and price scenarios for Demo mode
src/apiStrike REST calls, signing, deposits, the live adapter
src/wsPrice, user and L3 streams
src/hooks/useVektor.tsOwns grids per symbol, shield, hedge, auto-shift, regime and the watchdog
worker/The same engines running headless in Node
cli/Command-line interface over the engines

One adapter seam

Engines produce orders; an ExecutionAdapter sends them and reports fills. Demo mode uses the simulator, Live mode uses Strike. That is why Demo mode is the real engine code, not a mock screen.

src/quant/types.ts
interface ExecutionAdapter {
  mode: "live" | "sim";
  placeBatch(orders);
  placeStrategy?(req);      // brackets
  replaceAll?(symbol, orders); // auto-shift
  cancel(symbol, clientOrderId);
  cancelAll(symbol?);
  onFill(cb);
}

Order roles in the client ID

Grid orders are tagged vektor-grid-<id>-<rung>-<e|x|s>-<seq> (entry, exit, stop). Fills route by that tag, so the grid survives reconnects and reloads, and the proof page can attribute fills without any server of ours.

Tests

Run npm test. The suite covers the engines, simulator, backtester, CLI, Cardano witness merging and a full render of the app.