Documentation
¶
Overview ¶
Command obwasm compiles the matching engine to WebAssembly and exposes a small JSON API to JavaScript, so the browser demo and the live console run the *real* engine rather than a reimplementation (docs/DEMO-SPEC.md §3, docs/CONSOLE-SPEC.md).
The engine works in integer ticks/lots; this bridge stays decimal-facing for JavaScript, converting at an Instrument boundary (cent ticks, milli lots) so the front-end keeps sending and receiving human decimals.
Everything the console shows is computed HERE, by the shipping library code — sim.NoiseTrader drives the flow, pkg/signals computes OFI/CVD/imbalance/λ, pkg/surveillance watches every event. The page is a renderer; if a panel lies, the library lies.
Build: GOOS=js GOARCH=wasm go build -o web/obook.wasm ./cmd/obwasm
JS globals installed: obReset(seedOrSymbol), obSubmit(user,side,type,price,qty), obSnapshot(depth), obStep(n), obSignals(), obAlerts(since), obCancel(id,user), obSpoof(), obFlood(), obOpenOrders(user). Each returns a JSON string.