← All live demos
Trading & Risk Controls · Broker-Dealers, Prop Desks & Fund Operations adl.tradedesk · ADL 0.5.1

Trade Desk

Every order meets its limit before it meets the market.

Order management with pre-trade risk controls across multi-asset trading books: every ticket is checked at release against its book's active max-order limit, compliance's restricted list, and firm or desk kill switches, over-limit overrides require four-eyes approval from a different risk officer, kill switches require independent sign-off to lift, and append-only executions govern completion.

Declarative Domain Pipeline trader → book (desk) + exposurelimit (active | suspended) + instrument (tradable | restricted + note) → ticket (draft → pre-trade release checks → released → complete | cancel | daily 21:05 expire) · override (four-eyes approve | reject) · killswitch (firm/desk/book engaged → two-person release) · append-only fill
Trade Desk landing page showing the live 3D Three.js book-limit exposure floor with the stopped crypto desk callout alongside real-time counts of working orders, drafts, fills, overrides, and engaged kill switches
The Trade Desk landing page queries the live Kalos C++20/PostgreSQL backend on load to render every working and draft order against its book's max-order limit plane in 3D alongside real-time counts of working tickets, un-released drafts, fills, four-eyes overrides, pending override requests, and engaged kill switches.

Why Trade Desk Exists

Under the SEC’s Market Access Rule (Rule 15c3-5) and FINRA’s market-access oversight guidance, broker-dealers, proprietary trading desks, and institutional funds cannot rely on post-trade exception emails or client-side warning banners to contain aberrant order flow. Pre-trade controls have to stand directly in front of order release: checking pre-set order thresholds, blocking restricted securities, halting flow immediately when a kill switch is pulled, and preventing any single trader or risk officer from overriding their own controls under pressure.

Trade Desk implements that deterministic control layer — deliberately with zero probabilistic AI in the pre-trade path — as a single declarative ADL 0.5.1 suite (adl.tradedesk) running on the Kalos C++20 engine and PostgreSQL:

  • Pre-trade refusal at the moment of release: Every order enters as a draft ticket. Transitioning a ticket via release executes three server-side AEL checks atomically before releasedAt is stamped: no engaged firm or desk killswitch (killSwitchBlocksRelease), tradable == true on the referenced instrument (restrictedInstrumentsBlocked), and notional within the book’s active max_order_notional exposurelimit unless an approved override is on file (orderWithinLimitOrOverridden).
  • Four-eyes separation on both overrides and kill switches: Traders can request an override, but only risk (or admin) holds the transition guard to approve or reject it — and fourEyesOnOverrides rejects any approval where $record.approver == $record.requestedBy. Likewise, risk or ops can engage an emergency killswitch at firm, desk, or book scope, while killSwitchReleasedBySomeoneElse refuses resumption by whoever engaged it.
  • Execution-backed blotter & live 3D exposure floor: Venue fill rows attach only to released tickets (fillsOnlyOnReleasedTickets) and are append-only for operations staff, ticket.complete refuses to mark an order filled without executions on file (completeNeedsAFill), unfilled day tickets expire automatically at 21:05 (expireDayOrders), and /exposure/ renders all 12 books’ live working and draft exposure against 3D limit planes in Three.js with an automatic 2D SVG fallback.

Nothing is simulated in browser JavaScript: every blotter filter, role console, 3D bar, Try-It button (frontend/kit.json), and 422 RULE_VIOLATION refusal talks live to /api/v1/tradedesk/*.

Inside the 5-Desk, 12-Book Demonstration Floor

Every trader, book code, symbol, price, and execution venue in seeds/seed.yaml (deterministically generated by seeds/gen_seed.py with privileges: user role attribution) is fictional, spanning 12 books across five asset desks:

  • 12 Books & 24 Exposure Limits: Equities (EQ-CORE, EQ-EVENT, EQ-QUANT — $2M max order), Rates (RT-CURVE, RT-BASIS, RT-FLOW — $25M max order, with RT-FLOW’s position limit currently suspended by risk1), FX (FX-G10, FX-FLOW — $10M max order), Crypto (CR-SPOT, CR-ARB — $500K max order), and Commodities (CM-ENERGY, CM-METALS — $3M max order).
  • 12 Instruments Including an Active M&A Restriction (CRST): Equities (NWND, BLUP, CRST), Treasuries (UST-10Y, UST-2Y), FX pairs (EURUSD, USDJPY, GBPUSD), spot crypto (BTC-USD, ETH-USD), and commodity futures (CL-F27, GC-G27). Crestline Biotech (CRST) sits on the restricted list (tradable: false) with its required compliance note explaining the firm is advising on a pending acquisition.
  • 58 Tickets Across Every Lifecycle & Control Outcome:
    • 25 filled orders backed by 64 venue fill legs, including 5 over-limit block orders released only after a different risk officer approved an override — such as TD-20296 (Sell 32,100 NWND for $2,697,414, 135% of EQ-CORE’s $2M limit, entered by trader1, approved by risk1, and filled by ops1 on EXCH-B).
    • 16 released working orders, including 14 partially executed orders, TD-20300 ($31.32M UST-10Y at 125% of RT-BASIS’s $25M limit, working under an override approved by risk1), and unexecuted TD-20280 (Buy 2.7322 BTC-USD, ready to test completeNeedsAFill).
    • 7 canceled orders (3 client pulls, 3 canceled after risk rejected an override recommending child orders, and TD-20307 canceled on restricted CRST) plus 4 expired day orders swept at market close.
    • 6 draft orders poised to test every pre-trade refusal live: TD-20292 (BTC-USD) and TD-20293 (ETH-USD) held behind the crypto kill switch, TD-20304 ($3.31M NWND, 165% of limit) and TD-20305 ($3.85M GC-G27, 128% of limit) waiting in overridesPending, TD-20306 blocked on restricted CRST, and within-limit TD-20294 (CL-F27, ready to test fillsOnlyOnReleasedTickets).
  • 10 Kill Switches (engagedKillSwitches + Audit Trail): Nine historical halts across firm, desk, and book scopes (stale consolidated feed, frozen venue prices, runaway strategy sending 40 orders in 2 seconds, central-bank spike, exchange halt) each record distinct engagedBy and releasedBy actors. One kill switch is engaged right now on Desk crypto (engaged by risk2 after a venue paused withdrawals), halting all new crypto releases until risk1 (or admin) lifts it.

How ADL Enforces Pre-Trade Risk Controls on the Server

When a chief risk officer, internal auditor, or market-access examiner asks how a breach order reached a venue or whether a trader could bypass a desk halt via direct API calls, five declarative invariants in backend/domain.yaml guarantee the answer lives in PostgreSQL:

  1. Atomic three-gate release check (killSwitchBlocksRelease, restrictedInstrumentsBlocked, orderWithinLimitOrOverridden): Firing POST /api/v1/tradedesk/tickets/{id}/transitions/release evaluates cross-resource AEL query() expressions inside Kalos before committing status: 'released' and sets: { releasedAt: now() }. Any engaged firm or matching desk kill switch, any instrument with tradable == false, or any notional exceeding the book’s active max_order_notional limit without an approved override aborts the transaction with HTTP 422 RULE_VIOLATION.
  2. Role-separated, four-eyes limit overrides (override state machine & fourEyesOnOverrides): Traders ([trader, admin]) may create an override in requested, surfacing it in the risk-only overridesPending view (permissions: [risk, admin]). Only [risk, admin] can fire approve or reject, reject requires both approver and decisionNote, and fourEyesOnOverrides rejects $record.approver == $record.requestedBy.
  3. Emergency halts with independent resumption (killswitch & killSwitchReleasedBySomeoneElse): Both risk and ops can create an engaged killswitch immediately when a venue or feed misbehaves, broadcasting it through engagedKillSwitches. Lifting the switch requires [risk, admin], a mandatory releaseNote captured into the switch’s history timeline ("Released: {releaseNote}"), and $record.releasedBy != $record.engagedBy.
  4. Append-only executions & scheduled close expiry (fillsOnlyOnReleasedTickets, completeNeedsAFill, expireDayOrders): Only [ops, admin] can create fill records, updates/deletes are restricted to admin, fillsOnlyOnReleasedTickets blocks booking executions against non-released tickets, completeNeedsAFill prevents transitioning a ticket to filled when len(query('fill', { ticket: $record.id })) == 0, and expireDayOrders runs daily at 21:05 to transition unfilled released day tickets to expired.
  5. Mandatory explanations & immutable audit trails (restrictionsExplained, history, features: { audit: true }): Marking an instrument non-tradable without restrictionNote fails field validation (tradable == true || restrictionNote != null), canceling any ticket requires cancelNote (recorded as "Canceled: {cancelNote}" in ticket history), and every create, update, and transition across all 8 resources writes an immutable actor-stamped audit entry in Kalos.

Zero Sign-Up · Live Kalos Sessions

Sit at a Bench and Try It Live

Each card below signs directly into a real role-scoped JWT session on the production Kalos backend so you can test role queues, transitions, and server refusals immediately.

Production Interface Walkthrough

Inside Trade Desk — Screen by Screen

Captured directly from the live Kalos deployment. Click any screenshot to inspect full resolution or jump straight to that screen in the running application.

01

Multi-Asset Order Blotter & Trader Workbench (blotter View)

Signed in as trader1, the Blotter surfaces all 22 open working and draft tickets across equities, rates, FX, crypto, and commodities beneath a persistent red alert banner for the engaged crypto kill switch. Each row plots order notional against its book's active max-order limit and flags Restricted (TD-20306 in CRST), Override asked (TD-20304 at 165%, TD-20305 at 128%), Override approved (TD-20300 at 125%), and Kill switch holds (TD-20292, TD-20293).

Open Trader blotter as trader1 ↗
https://trade-desk.infinity-sdg.com/app/#as=trader1 Full size ↗
Trade Desk Blotter view signed in as trader1 showing 22 open tickets across five desks with notional-versus-limit gauges, Restricted, Override asked, Override, and Kill switch chips, and the engaged crypto desk kill-switch banner
02

3D Book-Limit Exposure Scene & Live Over-Limit Refusal (/exposure/)

The dedicated /exposure/ view plots all 12 books across 5 desks in Three.js WebGL (with an automatic 2D SVG lane fallback under reduced motion or headless environments): translucent blue planes mark 1.0x max-order notional, solid inner bars show executed fills, amber cages mark approved overrides (RT-BASIS), grey floors mark stopped desks (crypto), and clicking Try to release as trader3 on EQ-CORE's $3.31M draft TD-20304 triggers a live HTTP 422 orderWithinLimitOrOverridden refusal.

Explore live 3D book-limit exposure scene ↗
https://trade-desk.infinity-sdg.com/exposure/ Full size ↗
Trade Desk 3D WebGL exposure floor showing 12 book lanes across 5 desks, translucent 1.0 limit planes, stopped crypto desk banner, and a live 422 RULE_VIOLATION refusal on EQ-CORE ticket TD-20304 in the side inspector
03

Live 422 Crypto Kill-Switch Refusal on Within-Limit Ticket (TD-20292)

Crypto draft TD-20292 (Buy 1.9672 BTC-USD for $180,359 on book CR-SPOT) sits at just 36% of its $500,000 max-order limit in a tradable instrument. When trader3 clicks Release while risk2's crypto desk kill switch is engaged, Kalos immediately returns HTTP 422 RULE_VIOLATION ('A kill switch is engaged.' · killSwitchBlocksRelease) with zero state change.

Open Crypto Trader desk (trader3) ↗
https://trade-desk.infinity-sdg.com/app/#as=trader3 Full size ↗
Trade Desk ticket TD-20292 detail view as trader3 showing a live HTTP 422 RULE_VIOLATION refusal banner for killSwitchBlocksRelease alongside pre-trade check status indicators
04

Engaged Kill Switches & Two-Person Release Enforcement (engagedKillSwitches)

Risk officer risk2 engaged the emergency stop on Desk crypto after a venue paused withdrawals. Attempting to lift that same switch as risk2 returns an immediate Kalos HTTP 422 RULE_VIOLATION ('A different person must release this kill switch.' · killSwitchReleasedBySomeoneElse), preserving the same two-person discipline visible across all nine historical firm, desk, and book halts below.

Test two-person kill-switch release as risk2 ↗
https://trade-desk.infinity-sdg.com/app/#as=risk2 Full size ↗
Trade Desk Kill switches console signed in as risk2 showing a live HTTP 422 RULE_VIOLATION refusal when risk2 attempts to release their own engaged crypto kill switch above nine historical two-person release records
05

Risk Officer Bench & Four-Eyes Limit Override Gate (TD-20304)

Draft equities block order TD-20304 ($3,307,241 in NWND, 165% of EQ-CORE's $2,000,000 limit) sits in overridesPending after trader3 requested a one-off breach override. Attempting to record the requester (trader3) as the approver triggers HTTP 422 RULE_VIOLATION ('A different risk officer must approve this override.' · fourEyesOnOverrides), enforcing independent risk sign-off on every limit breach.

Sit at the Risk Officer's desk (risk1) ↗
https://trade-desk.infinity-sdg.com/app/#as=risk1 Full size ↗
Trade Desk ticket TD-20304 signed in as risk1 showing a live HTTP 422 RULE_VIOLATION refusal for fourEyesOnOverrides when trader3 is entered as approver on a 165%-of-limit $3,307,241 order
06

Operations Bench & Compliance Restricted-List Enforcement (CRST)

Signed in as ops1, Operations maintains reference instruments, books append-only fills against released orders, completes filled tickets, and manages the compliance restricted list. Crestline Biotech (CRST) is marked Restricted with its mandatory advisory reason ('Firm is advising on a pending acquisition; restricted until the deal is announced'), causing restrictedInstrumentsBlocked to refuse release on draft ticket TD-20306.

Open Operations bench (ops1) ↗
https://trade-desk.infinity-sdg.com/app/#as=ops1 Full size ↗
Trade Desk Restricted list view signed in as ops1 showing Crestline Biotech (CRST) marked Restricted with its M&A advisory restriction note above eleven tradable multi-asset instruments

Declarative Server Enforcement

What the Kalos Server Refuses — Whoever Asks

These invariants live in the ADL domain definition, not in client-side UI JavaScript. Every REST request is checked by Kalos before touching PostgreSQL, and any violation returns a structured error naming the rule.

Attempted Operation Enforced ADL Rule / Guard Regulatory Alignment
Release any ticket while a firm-wide or matching desk kill switch is engaged killSwitchBlocksRelease SEC Rule 15c3-5(b) · FINRA Market Access emergency kill-switch controls
Release a ticket for an instrument on the compliance restricted list (tradable == false) restrictedInstrumentsBlocked · instrument.restrictionsExplained SEC Rule 15c3-5(c)(2) · Restricted-security & M&A watch-list blocking
Release a ticket whose notional exceeds its book's active max-order limit without an approved override orderWithinLimitOrOverridden SEC Rule 15c3-5(c)(1)(i) · Pre-trade capital & order-size thresholds
Approve a book-limit override when the recorded approver is the same person who requested it fourEyesOnOverrides · override.approve [risk, admin] Four-eyes supervisory sign-off on credit & limit breaches
Release an engaged firm, desk, or book kill switch as the same person who engaged it killSwitchReleasedBySomeoneElse · killswitch.release (releaseNote) Independent two-person sign-off before resuming market access
Book a venue execution fill against a draft, canceled, expired, or already completed ticket fillsOnlyOnReleasedTickets · fill permissions (append-only) Order-to-execution blotter integrity
Mark a released ticket filled when zero execution fills are on record for that ticket completeNeedsAFill · expireDayOrders (daily 21:05 schedule) Verified execution reconciliation & end-of-day order expiry
Cancel a ticket, reject an override, or restrict an instrument without recording a written reason ticket.cancel (cancelNote) · override.reject (decisionNote) · restrictionsExplained Reconstructable supervisory & compliance audit trail

Domain Footprint

ADL Suite Inventory

Resources (8)

traderbookinstrumentexposurelimitticketoverridekillswitchfill

RBAC Roles (4)

traderriskopsadmin

Declarative Views (3)

blotteroverridesPendingengagedKillSwitches