Live Order Desk

A Fluxtion event processor compiled to WebAssembly, driven from this page through the generic JSON bridge. Orders and prices are events; risk decisions, positions and market data come back through named sinks. No server, no AI on the path — the rules run on-device in WASM.

loading WASM…

Send events (JSON in)

Risk rule (in the SEP): reject if qty ≤ 0 or the resulting net position would exceed ±1000. Accepted orders update the position book via a JS-backed service.

Positions · browser state read + stored by the SEP service

symbolnet position
none yet

Market data · "marketData" sink

no ticks yet

Accepted · "accepted" sink

    Rejected · "rejected" sink


      Event flow — how one event travels the SEP

      desk.onEvent({ type:'order', symbol:'EURUSD', side:'buy', qty:100 })       ← JS sends a plain object
             │
             ▼   the bridge wraps it as StringEvent("order", json); "type" routes it
        ┌─────────────────────────────────────────────────────────────┐
        │ OrderRiskNode   @OnEventHandler(filterString = "order")      │
        │   • book.position(sym)            → reads  browser state     │   PositionBook
        │   • limit rule (±1000)                                       │   = your JS
        │   • book.store(sym, next)         → stores browser state     │   (read + write)
        │   • processReentrantEvent( Accepted | Rejected )             │
        └──────────────────────────────┬──────────────────────────────┘
                                       ▼
                        re-injected as a TYPED event
                                       │
               subscribe(Accepted).map(toJson).sink("accepted")
                                       │
                                       ▼   the value reaches the named sink
                  desk.subscribe('accepted', o => addRow(o))   → updates the UI
      
        ▸ price events flow the same way:  PriceNode → PriceTick → "marketData" sink
        ▸ every node invocation above is recorded in the audit log below

      Audit log · drainAudit() — the diagnostic trail of every node that fired

      (send an event to see the audit trail)

      How it's built — the code behind this page

      The whole app is the generic bridge plus one service wiring. The Java is the graph (risk rule + sinks); the JavaScript drives it with plain objects.