9 weeks · 3 roles · one live market

Systematic Trading
with GenAI

A graduate systems-engineering course disguised as a trading competition. You design the objects, make them concurrent, put a protocol under them, backtest them, speed them up, learn from them — and every week your code connects to AlgoArena, a live Python exchange where your bot competes against your classmates on real Yahoo Finance prices.

Start with Week 1 See the 9-week map How the season works
3
Roles: exchange · broker · trader
6
Unlock levels per role
9
Live weekly sessions
8765
The WebSocket port
The learning path

Nine weeks, one system

Each week is a concept, a piece of code, and a live market session. Nothing is thrown away: the class hierarchy you draw in Week 1 is the thing you make concurrent in Week 2, protocol-ise in Week 3, backtest in Week 4, optimise in Week 6 and defend in Week 9.

Strategy Momentum MeanRev
Week 1

UML & Object-Oriented Programming

Model the arena as objects, then sketch it in UML before you write a line of code.

4 pillarsABCsclass diagrams
Open week 1
loop feed strategy orders
Week 2

Concurrency & Async in Python

One event loop, many tasks — juggle a feed, orders and fills without ever blocking. Then the threads and processes it hands work to: the GIL, a live race, measured speedups.

asyncioGILthreadsprocesses
Open week 2
client venue len json len TCP gives you bytes, not messages
Week 3

Socket Streaming & Protocols

From the seven OSI layers up: UDP vs TCP, the socket API, FIX, ITCH and OUCH, then the arena's WebSocket and a validated wire contract.

OSITCP/UDPFIX/ITCHWebSocket
Open week 3
replay: 2019 → 2024
Week 4

Backtesting and Its Data

What a backtest is for, where tick data lives (SQL, kdb+, Parquet), logical vs real time, and a Parquet-backed backtester that gives the same P&L at every replay speed. One page: widgets, checklist and interview questions.

backtestSQL → kdb+ → Parquetas-of joinlogical clock
Open week 4
MIDTERM ✓ W1 OOP✓ W2 async ✓ W3 sockets✓ W4 backtest
Week 5

Midterm week — no class

The midterm on Weeks 1–4 and how to prepare. No new teaching; the graded live block still runs that evening.

midtermweeks 1–4revision
Open week 5
O(1)O(log n) O(n²)
Week 6

Algorithmic Complexity & Data Structures

Pick the right structure, know its cost, and profile the hot path inside the order book.

big-Oheapsprofiling
Open week 6
driver worker 0 worker 1 worker 2 worker 3
Week 7

Big Data & Distributed Computing

Think in columns and processes — parallelise a strategy search, not one lonely config.

columnarparquetmultiprocessing
Open week 7
traintest roll →
Week 8

Machine Learning Signals & Model Ops

Train offline, validate walk-forward, predict inside on_tick — without fooling yourself.

featuresleakagemodel ops
Open week 8
1 · team alpha 2 · team beta 3 · team gamma
Week 9

CI/CD, Testing & UI + Integration & Season Finale

Make the bot tested, reproducible and observable — then prove it end to end, measure it with a real tearsheet, and defend it. The leaderboard locks.

pytestDockerintegrationtearsheet
Open week 9
Interactive

How the season works — follow one order all the way to P&L

Three student-built roles share one WebSocket. The Broker turns Yahoo Finance prices into resting quotes, the Exchange matches, the Trader aggresses. Step through the lifecycle and watch the money move: every number below is computed from the arena's real fee model (taker 0.0015, maker rebate 0.0010).

Yahoo Finance BROKER market maker earns the spread EXCHANGE CLOB · price-time earns the fees ws://…:8765 TRADER your bot earns the edge ORDER BOOK · AAPL ask — bid — msg
step 0 / 7

Press Step to begin

Handshake(team_id="T07", role="trader", level=1)

Every message on the wire is a pydantic model from shared/messages.py — never a raw dict.

Trader · team T07

cash
100000.00
position
0
net worth Δ
0.00

Broker · team BRK

inventory
0
quoted spread
—
net worth Δ
0.00

Exchange · venue

taker fee
0.00
maker rebate
0.00
net revenue
0.00
The three P&Ls always sum to zero — nobody creates value, they transfer it. That is the whole competition: decide which side of the transfer you want to be on.
Pick a side

Three roles, three business models

In Week 1 you declare a role. It decides what you build, how you earn, and which unlock ladder you climb for the rest of the season.

What you build

A WebSocket server with a central limit order book. Price-time priority matching, order acks, book snapshots, portfolio updates — the venue everyone else connects to.

How you earn

Transaction fees. Under the maker/taker model you collect 0.0015 from the aggressor and pay 0.0010 back to the resting order; the difference is yours. Set fees too high and flow leaves for another venue.

Your ladder

  • L1 basic CLOB, flat fee
  • L2 portfolios & leaderboard
  • L3 maker/taker fees
  • L4 circuit breakers (LULD)
  • L5 rate limits & order types
  • L6 full analytics dashboard
Week 0 · before anything else

Start here — six steps to a green smoke test

Week 1 assumes Week 0 is green. Tick each step as you finish it; the lamp turns green when your environment is ready to connect to the arena. (Your ticks are kept only in this browser tab.)

Smoke test: RED · 0 of 6 steps

If something is red

ConnectionRefused when the bot connects

The exchange server is not running yet — the instructor starts it first.

Check EXCHANGE_HOST and EXCHANGE_PORT in your .env.

pydantic import error

The arena requires pydantic v2 and will not run against v1.

Re-run make install in a clean 3.11 venv; never mix v1 and v2.

API key not found on Windows

export is not persistent on Windows shells.

Copy .env.example to .env and load it with python-dotenv. Never commit .env.

yfinance rate-limited

Yahoo throttles aggressive polling; a tight yf.download() loop will get you blocked.

Respect YAHOO_POLL_INTERVAL (5s default); the broker SDK already backs off.

Bot missing from the teacher dashboard

The handshake was accepted but under a team the instructor does not know.

Your TEAM_ID (and ARENA_TOKEN) must match the registered roster exactly.

Where to go next

Start here, get the code, see the prequel

Begin
Week 1 · UML & OOP
Model the arena as objects, then draw it before you build it.
Code
Get the code
Labs and homework live in your course’s LMS; the starter repo is public. Use it as a template, clone, make install.
Prequel
Computer Architecture Arena
Nine interactive dashboards on the machine your Python actually runs on — from the Turing machine to tick-to-trade.