Tech
Architecture
Pure engines, one adapter seam, two backends: how the code is organised.
Layers
| Folder | Contents |
|---|---|
src/quant | Pure engines with no React and no network: grid, funding, shield, whale radar, L3, regime, backtest, backfill |
src/sim | In-memory matching engine and price scenarios for Demo mode |
src/api | Strike REST calls, signing, deposits, the live adapter |
src/ws | Price, user and L3 streams |
src/hooks/useVektor.ts | Owns 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.