surveillance-frontier · a research project in market surveillance

How well can a surveillance policy be stress-tested within a fixed time budget?

Each phase fixes its hypotheses before measuring. So far, the right exact algorithm on a 32-core CPU brings both stated tasks well under the hour, and a GPU engine is next.

10 s1 min10 min1 h1 day10 daysPhase 0 · pilotColab T4 · donesame 60 s budget: the GPU ran 53× more trials, so its interval was 6.7× narrowerPhase 1 · 32-core CPUT1 · 1 policyfull 4.0 h43 sT2 · 24 policiesfull 15.2 days12 minPhase 2 · nextdesignedlarger tasks · bit-identical GPU engine vs incremental CPU1-hour line, fixed before measuringsolid: measured · dashed: designed1 min1 h1 dayPhase 0 · pilotsame 60 s: 53× trials, 6.7× narrowerPhase 1 · 32-core CPUT14.0 h43 sT215.2 days12 minPhase 2 · nextGPU vs CPU, larger tasks1-hour line, fixed in advancesolid: measured · dashed: designed
The whole project on one clock. Phase 0 measured what a minute buys, Phase 1 how long the stated tasks take with exact CPU methods; Phase 2 is designed, not yet measured.

Oct 2026 – ongoingC++17 · OpenMP · CUDA · PythonGitHub (opens in a new tab)README (opens in a new tab)

01What the detector sees

On 2024-01-09 a fake post from the SEC's hacked X account moved Bitcoin by more than $1,000 in minutes. The detector ranks every window — each start × 15 lengths, about two million per quarter — against windows of its own length, so an event draws a cone of rare windows.

Fig. 1 · Rarity of every window around the fake SEC post, 1-minute bars

Price, USDT (high–low per bar)46,00048,000vol.2832128256window (min)19:0020:0021:0022:0023:0000:00fake SEC post, 21:11 UTCRarity, for its lengthalltop 10%1%0.1%0.01%0.001%Price, USDT46k48kvol.2832128256len (min)19:0021:0023:00fake SEC post, 21:11 UTCRarity: top share of windows of that lengthall10%1%0.1%0.01%0.001%
Columns are window centres, rows window lengths. Short windows react first; long ones stay rare for longer.Recomputed from the project's data with the Phase 0 score · Phase 0, section 2 (opens in a new tab)

02Evaluating a policy means repeating one trial thousands of times

Whether a policy holds up is an estimate: inject a test event, re-run the detector, count the hits. Its precision depends on how many trials fit in the time — the quantity every hypothesis of the project is about.

Fig. 2 · One trial, and what n trials estimate

  1. 1

    Fix one series

    A real BTCUSDT series x: a week of 1-s bars or a quarter of 1-min bars.

  2. 2

    Inject a test event

    A rise-and-fall of length L and strength q at a start s drawn at random.

  3. 3

    Re-run the policy

    Scan, rank, select. A policy sets window lengths, threshold and merge gap.

  4. 4

    New episode inside?

    A hit only if centred in the event and absent from the unchanged series.

  5. 5

    Repeat n times

    Hits / n estimates the detection rate p(L, q | x) with a 95% interval.

T1: one policy over 8 lengths × 17 strengths, 333,064 trials. T2: 24 policies with all 3,264 intervals holding at once, 1,594,736 trials.
HypothesisCriterion → resultVerdict
H1Group-level policies bound the undetected effect; account-level ones do not.needs group policies and damage boundsnot tested
H2Even the fastest exact CPU method needs more time than is available.> 1 h criterion, result 12.1 minnot supported
H3A bit-identical GPU engine reaches the same accuracy sooner.Phase 2not tested
H4At equal wall-clock time, the GPU's estimate has a smaller error.Phase 2not tested

03Two measurements that shaped the project

The pilot showed that precision is bought with re-runs. Before giving that job to a GPU, Phase 1 asked what the best exact CPU method costs — and found full recomputation was far from its floor.

Phase 0 · same time budget, CPU vs GPU

00.10.20.30.4estimated hit rate, 95% intervaltrials run10 sCPU18GPU1,03230 sCPU60GPU3,19560 sCPU119GPU6,31200.10.20.30.4estimated hit rate, 95% intervaltrials run10 sCPU18GPU1,03230 sCPU60GPU3,19560 sCPU119GPU6,312
In 60 s the GPU ran 53× more trials; its interval was 6.7× narrower. CPU side: full re-run on two cores.Phase 0, section 5 (opens in a new tab)

Phase 1 · time per trial, N = 604,800, one thread

full1,180.55 msscan 147.1 · rank 1,025.57 · select 7.87 ms
tail224.27 msscan 147.16 · rank 70.12 · select 7.16 ms
incremental3.36 msscan 0.04 · rank 1.87 · select 1.44 ms
Incremental evaluation recomputes only what an event touches: 349× faster, with results identical in 2,112 checks.Phase 1, section 3 (opens in a new tab)

04Read each phase

Each phase page opens with its core result, then the evidence: correctness gates, the measurements, and every hypothesis with its verdict.

  1. Phase 0 · pilotWhen does a GPU help an exhaustive window scan, and what does a time budget buy?Read Phase 0 →
  2. Phase 1 · feasibilityWhat does a stated stress-testing task cost with the fastest exact CPU method?Read Phase 1 →
  3. Phase 2 · designedDoes a bit-identical GPU engine beat the incremental CPU on larger tasks?Protocol on GitHub ↗ (opens in a new tab)

Scope. Rates are conditional on one asset and two periods; no damage bound is reported yet; task times are projections from measured throughput; detectors are research reimplementations, and nothing here labels trading as manipulative.