Case Study 03

Real-Time Bitcoin Anomaly Detection

Kinesis + Lambda pipeline with SNS alerting

AWS KinesisLambdaIsolation ForestFirehoseAthenaQuickSight
View on GitHub (opens in new tab)

The Problem

Cryptocurrency markets move fast and generate huge volumes of tick data — flagging anomalous price or volume behavior only matters if it happens in near real time. The goal was a pipeline that could ingest and process thousands of records a day with sub-second detection latency, without relying on brittle manual thresholds.

Approach

  1. 01Ingested raw data through a Kinesis data stream, with a Python processing layer computing derived features and pushing them onto a second, processed Kinesis stream.
  2. 02Ran a Lambda function on the processed stream that scores each record with a trained Isolation Forest model, firing an SNS alert immediately whenever an anomaly is flagged.
  3. 03Delivered both raw and processed data to S3 via separate Firehose streams, keeping a full historical record independent of the real-time alerting path.
  4. 04Queried the S3 data with Athena and built a QuickSight dashboard for real-time and historical visualization.

Visuals

Architecture diagram of the Bitcoin anomaly detection pipeline: Kinesis raw data stream into Python processing, a processed Kinesis stream, a Lambda function running the ML model that sends SNS alerts on anomalies, and parallel Firehose deliveries into S3, Athena, and a QuickSight dashboard
Pipeline architecture: Kinesis ingestion → Lambda anomaly scoring → SNS alerts, with parallel Firehose delivery into S3, Athena, and QuickSight.

Results

Processed 10K+ records/day with sub-second anomaly detection latency.

~30% precision improvement over statistical threshold baselines.

60% reduction in manual monitoring effort.

Reflection

Moving from a statistical threshold baseline to a learned Isolation Forest model was the single biggest improvement — thresholds are brittle and need constant re-tuning as market volatility shifts, while the model adapts to the shape of 'normal' data automatically.