Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/Market surveillance on lambda using nvidia nim
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

Market surveillance on Lambda using NVIDIA NIM

Source: Lambda•December 3, 2026 at 08:05 PM

Market surveillance on Lambda using NVIDIA NIM

Financial markets generate millions of order events per day. Hidden inside that stream are manipulation patterns (spoofing, layering, quote stuffing) that cost market participants money and expose firms to regulatory risk. Catching them fast is the hard part. Spoofing patterns that aren't flagged within seconds of occurring are too late to act on. Processing millions of order events fast enough to matter is a GPU problem.

In this post, we'll walk through an end-to-end market surveillance pipeline we built on Lambda NVIDIA H100 Tensor Core GPU and NVIDIA Blackwell GPU instances using NVIDIA NIM. The pipeline detects anomalies in real NASDAQ Limit Order Book (LOB) data using two complementary approaches: a supervised cuML Random Forest and the unsupervised NVIDIA Kumo Anomaly (formerly NV-Tesseract AD-Diffusion), and automatically generates formal compliance alerts via NVIDIA Nemotron™-3-Super-120B. On Blackwell, we also showcase Nemotron-3-Ultra-550B, a 550B-parameter model that runs on 2x Blackwell GPUs in NVFP4. All inference runs locally on Lambda hardware with no data leaving the cluster.

The dataset: LOBSTER real NASDAQ market data

We used LOBSTER market data: reconstructed Level 2 order book snapshots for AAPL, AMZN, and MSFT from a single trading day (June 21, 2012), taken from LOBSTER’s free public sample dataset. LOBSTER is useful for anomaly detection because it labels the event type of every order action: new submissions (type 1), cancellations (types 2–3), and executions (types 4–5). That level of detail lets us derive manipulation indicators directly from the data, without synthetic labeling. We computed features and rule-based labels for all three stocks. The model results below use MSFT, the most active of the three (595,800 events).

The pipeline

The full model implementation pipeline runs in seven steps, all GPU-accelerated on Lambda hardware:

Step 1: GPU-accelerated feature engineering with RAPIDS

The raw LOBSTER files contain bid/ask prices and sizes at five price levels, plus event-type metadata.

A raw LOBSTER message file:

A corresponding order book snapshot at five price levels:

Event types (LOBSTER encoding):

  • New limit order submission
  • Partial cancellation
  • Full cancellation
  • Execution against a visible limit order
  • Execution against a hidden limit order

Cancellation events (types 2 and 3) make LOBSTER particularly valuable for manipulation detection; they let us compute cancel_rate and cancel_to_trade directly from the data, rather than inferring them indirectly.

We used RAPIDS cuDF to compute 8 microstructure features directly on GPU, processing 1M+ events without ever leaving GPU memory:

Each feature maps directly to a known manipulation signature:

  • order_imbalance and vol_imbalance_5: spoofers create artificial buy or sell pressure at the top of the book (and deeper levels) to move price before canceling
  • cancel_rate and cancel_to_trade: the defining behavioral signature of both spoofing (high cancel rate) and layering (high cancel-to-trade ratio); events with cancel_to_trade of 100 (the cap, meaning 100 or more cancels per trade) appear regularly in flagged events
  • spread_vol, mid_return, spread, mid_price: contextual features that give the models the surrounding market conditions to judge whether anomalous order flow is truly unusual or just normal volatility

The feature engineering loop runs per-stock (AAPL, AMZN, MSFT separately) so rolling-window calculations don't bleed across different instruments. All three stocks are then concatenated into a single GPU dataframe for downstream processing.

Note: Code snippets are simplified for readability. Some helper functions and intermediate variables are omitted. The full notebooks are available on request.

Step 2: Rule-based labels

Before training any model, we generated ground-truth labels using fixed thresholds derived directly from the LOBSTER event types:

These labels serve two purposes: they train the supervised Random Forest and act as a comparison baseline for what Kumo Anomaly independently catches. The rules are fixed-threshold logic. The Random Forest is a separate model trained to learn those patterns and generalize them.

Step 3: Supervised detection (cuML Random Forest)

The Random Forest is trained on the rule-based labels to learn whether it can generalize the threshold logic across a wider test set:

Results on the MSFT test set (119,160 rows):

B200's higher recall (0.980 vs 0.915) is significant; in a compliance context, false negatives carry regulatory risk. Both instances ran RAPIDS on dedicated GPUs isolated from the NIM containers (NVIDIA CUDA™_VISIBLE_DEVICES set to free GPUs on both instances) to ensure a fair comparison.

Step 4: Unsupervised detection (Kumo Anomaly NIM)

This is where the pipeline goes beyond what rules alone can find.

Kumo Anomaly is a time-series foundation model for multivariate anomaly detection. It uses a diffusion-based architecture trained on a broad distribution of time-series patterns, scoring each event by its mean absolute error (MAE) from expected behavior. No labels required, entirely unsupervised.

We deployed it as a self-hosted NIM container on a single GPU:

The inference call sends a window of LOB feature vectors via the /v2/detect-anomalies REST endpoint:

At 100k events, sending the full payload in a single request times out on the server side; Kumo Anomaly’s diffusion sampling has a fixed compute cost per batch. We chunked into 5,000-row batches:

Results for two surveillance modes:

2k window (real-time mode)

100k window (batch scale mode)

The most important number: 4,506 events on H100 that the rules didn’t flag, all candidates for review. Kumo Anomaly identified these as statistically anomalous without any knowledge of spoofing or layering, based purely on distributional deviations in the microstructure features.

A note on the detection overlap rows: "both flagged" events are those where Kumo Anomaly and the rule-based labels independently agreed. "Kumo Anomaly only" are novel anomalies with no matching rule signature. "Rules only" are known patterns Kumo Anomaly didn't score as anomalous. The low overlap (2–4 events out of 2,000 in the real-time window) confirms the two detection methods are complementary; they are largely catching different things.

Blackwell has 49% higher throughput and is 33% faster on the 100k batch (734s vs 1,093s).

Top five highest-scoring events from the 100k window (H100):

Step 5: Compliance alert generation (Nemotron-3-Super-120B NIM)

Flagged events from Kumo Anomaly and the Random Forest are passed to Nemotron-3-Super-120B, NVIDIA's hybrid LatentMoE model (Mamba-2 + MoE + Attention, 120B total / 12B active parameters), to generate formal compliance alerts.

On H100, the NIM auto-selects FP8 on 4 GPUs. On Blackwell, it runs the same 120B model in NVFP4 (NVIDIA Blackwell-native) on half the GPUs:

Each detected anomaly's numeric indicators are interpolated into a structured prompt:

Sample outputs

H100, FP8, Alert 4 (MAE 1.6192, order imbalance -0.7750, strong sell pressure):

Compliance alert. The NVIDIA Kumo Anomaly model has detected a statistical anomaly in the MSFT limit order book, with an anomaly score (MAE) of 1.6192, indicating significant deviation from normal microstructure. Key indicators include a pronounced order imbalance of −0.7750 (strong sell pressure), a volume imbalance of −0.4010 across the top five levels, a 50% cancellation rate suggesting rapid order turnover, and a tight $0.01 spread. Recommended action: initiate immediate manual review of MSFT trading activity, verify for potential manipulative behavior or erroneous order flow, and consider temporary heightened surveillance or trading restrictions pending further investigation.

Blackwell, NVFP4, Alert 4 (MAE 1.6719, order imbalance 0.1640, slight buy pressure):

Surveillance alert. A statistical anomaly has been flagged in the MSFT limit-order book by the NVIDIA Kumo Anomaly model, with an MAE-based anomaly score of 1.6719. Key indicators include a mid-price of $30.70, an order imbalance of 0.1640, a high cancel rate of 40.00%, a volume imbalance of 0.0526 across the top five levels, and a tight spread of $0.02. Given the elevated cancel rate and pronounced order imbalance, which may signal potential manipulative quoting or latency-arbitrage activity, immediate escalation is recommended.

Step 6: Concurrent throughput

Sequential alert generation (one request, wait, next request) doesn't reflect production reality. During volatile market conditions, dozens of anomalies may be flagged simultaneously, requiring burst alert generation. We tested concurrent throughput using Python's asyncio + aiohttp to fire batches of 100 requests at three concurrency levels, identically on both instances:

The c=100 result (29.03 vs 10.19 alerts/sec) is the most meaningful production-scale comparison.

Sequential warm latency tells a similar story: 0.95s on Blackwell vs 1.73s on H100, 45% faster, on half the GPU count.

Step 7 (Blackwell only): Nemotron-3-Ultra-550B-A55B

Only one model in this stack runs on B200: Nemotron-3-Ultra-550B-A55B. It ships in NVFP4, a Blackwell-only format, so it can’t run on H100. On 2 Blackwell GPUs, it used about 172GB per GPU in our runs (measured with nvidia-smi):

Ultra-550B is ~2x slower than Super-120B per alert on the same 2 Blackwell GPUs; this is expected given 4.6x more active parameters. The 1M-token context window opens up longer-horizon market pattern analysis that Super-120B's 262k context can't address.

H100 vs Blackwell: the full picture

The headline: running Nemotron-Super on half the GPUs, Blackwell delivers 2.9x peak alert throughput and 45% faster warm inference. Kumo Anomaly throughput is also 49% higher.

Data residency: why this architecture matters for FSI

Every request in this pipeline is a local HTTP call to a container running on the same Lambda instance:

No trading data reaches an external API endpoint. No model weights are hosted remotely. For FSI firms subject to data sovereignty requirements or internal data residency policies (a common requirement), this is a meaningful architectural advantage over cloud-hosted inference endpoints.

Environment

H100 instance: Driver 580.105.08, CUDA 13.0, Python 3.10, PyTorch 2.5.1+cu121, RAPIDS 26.02 stable -cu12

Blackwell instance: Driver 580.126.20, CUDA 13.0, Python 3.12, PyTorch nightly cu130, RAPIDS 26.04 nightly -cu13

NIM containers require an NGC API key. Kumo Anomaly requires separate access approval via your NVIDIA contact. Nemotron-Ultra-550B requires an NVIDIA AI Enterprise (NVAIE) trial (90-day trial available).

GPU allocation:

What's next

The models in this post ran on MSFT order data from a single trading day. Natural extensions include real-time streaming ingestion (rather than batch LOBSTER files), multi-stock concurrent surveillance, and prompt refinement for specific regulatory frameworks (MiFID II, FINRA Rule 5210). The concurrent throughput benchmark also opens up a natural conversation about how alert generation scales as surveillance coverage expands, and where Blackwell’s larger VRAM headroom compounds the advantage at higher concurrency.

Want to build this pipeline yourself? Talk to our team. We’ll walk through the full setup and notebooks.

← All articles

What this article says

More in AI & Machine Learning

All →
Redis vs Mem0 for production-grade agent memory
Redis

Redis vs Mem0 for production-grade agent memory

Introducing FLUX 3.1 Image
Black Forest Labs

Introducing FLUX 3.1 Image

Introducing Krea Bots
Krea AI

Introducing Krea Bots

Best voice agent API in 2026: 6 options compared for developers
AssemblyAI

Best voice agent API in 2026: 6 options compared for developers

Multilingual voice agents: building agents that speak to anyone
AssemblyAI

Multilingual voice agents: building agents that speak to anyone

Toward goal-oriented agent improvement with LangSmith Engine
LangChain

Toward goal-oriented agent improvement with LangSmith Engine

More from Lambda

Making LLMs forget what they shouldn’t know
Lambda

Making LLMs forget what they shouldn’t know

Sequence-level RL for diffusion language models
Lambda

Sequence-level RL for diffusion language models

RoCE and NVIDIA Quantum InfiniBand, and their quantified tradeoffs
Lambda

RoCE and NVIDIA Quantum InfiniBand, and their quantified tradeoffs

Lambda announces the world’s first large-scale CPO deployment of NVIDIA Photonics switches
Lambda

Lambda announces the world’s first large-scale CPO deployment of NVIDIA Photonics switches

Lambda delivers faster AI training for language and image models
Lambda

Lambda delivers faster AI training for language and image models

TurboPairFormer: faster, more stable, more accurate OpenFold3 fine-tuning
Lambda

TurboPairFormer: faster, more stable, more accurate OpenFold3 fine-tuning