Ticker Plant

Hard ● Live C++ Rust Java Python

The Problem

Normalize and aggregate 2,000,000 trade messages from 4 different stock exchanges into consolidated OHLCV (Open, High, Low, Close, Volume) bars. Each exchange has different timestamp formats, decimal precision, and message ordering.

The ticker plant is the heart of market data infrastructure: it consumes raw exchange data and produces standardized, time-bucketed quotes for the rest of the trading system.

Evaluation Criteria

Correctness (70%)

All trades aggregated correctly. OHLCV values must be exact within 0.01 per value. Time bucketing and exchange deduplication must be 100% accurate.

Performance (30%)

Wall-clock time on 2M trades from 4 exchanges.

Exchange Message Format

NYSE Format

ISO 8601 timestamp, symbol, price, volume, buyer_id, seller_id

2026-01-01T09:30:00.000Z,AAPL,150.25,1000,BUYER_A,SELLER_B

NASDAQ Format

Unix milliseconds, symbol, price (2 decimals), quantity, exchange_id

1704110400000,MSFT,300.50,500,NASDAQ

CBOE Format

Unix microseconds, symbol, price (4 decimals), quantity

1704110400000000,GOOG,140.2500,750

IEX Format

Custom: HHMMSS.mmm, symbol, price, size

093000.000,TSLA,250.10,2000

Aggregation Rules

Time Buckets

Aggregate trades into 1-second OHLCV bars. Bucket = floor(timestamp / 1000) * 1000.

OHLCV Computation

Deduplication

Messages with identical (timestamp, symbol, price, volume) are duplicates and should be counted only once.

Input Format

First line
N = total number of messages across all exchanges.
Each message
pipe-separated, first field is the exchange tag, remaining fields vary by exchange:

Output Format & Sample

Sample input (first 8 lines, full file linked below):

30
NYSE|1609459302034126396|AMZN|159.98|180|B
NYSE|1609459583768820204|AAPL|149.63|280|B
IEX|1609460918.163032|ADBE|500.12|10|B
NYSE|1609462327385451171|NVDA|850.66|440|B
IEX|1609461672.307419|NFLX|399.99|590|B
BATS|1609459302081|AMZN|159.98|180|B|TX349957310
BATS|1609460756686|AMZN|159.86|470|B|TX386665249
... (more)

Expected output for that sample (first 8 lines):

16 28
1609459213 SHOP 519.260000 519.260000 519.260000 519.260000 930 519.260000 1
1609459286 GOOG 139.090000 139.090000 139.090000 139.090000 290 139.090000 1
1609459302 AMZN 159.980000 159.980000 159.980000 159.980000 360 159.980000 2
1609459460 MU 85.230000 85.230000 85.230000 85.230000 500 85.230000 1
1609459476 AMD 139.620000 139.620000 139.620000 139.620000 50 139.620000 1
1609459582 AAPL 150.620000 150.620000 150.620000 150.620000 970 150.620000 1
1609459583 AAPL 149.630000 149.630000 149.630000 149.630000 280 149.630000 1
... (more)

↓ download full sample input  |  ↓ download expected output

Test your solution locally: ./your_solution < input.txt | diff - output.txt

Common Pitfalls

Performance Tier Thresholds (applied by the grader)

LanguageGoldSilverBronzeTier 4
C++<500ms<2000ms<8000mselse PASS
Rust<500ms<2000ms<8000mselse PASS
Java<1000ms<4000ms<15000mselse PASS
Python<4000ms<12000ms<50000mselse PASS

Submission Rules

Challenge Stats

Trade messages: 2,000,000
Exchanges: 4
Symbols: ~500
Time span: ~1 trading day (~8 hours)

Starter Templates

↓ skeleton.cpp ↓ skeleton.rs ↓ Skeleton.java ↓ skeleton.py

Submit Your Solution

You can submit multiple times. Best result per language counts.

Resources

Leaderboard →