A real-time system is not a fast system. It is a system with a deadline — it must sense the world, decide, and act before a clock runs out, and an answer that arrives late is simply wrong. This course builds that one loop ten weeks deep in AlgoArena, a live Python market, then bolts intelligence into its hot path and re-instantiates the same loop as a detector, a vision pipeline and a car controller.
After week 2, every week consumes something an earlier week built. The objects you draw in week 1 become the async tasks of week 2, the trading system of week 3, the signal of week 4; week 5 splits the venue in two, week 6 reads its own session tape, week 7’s perception stage becomes week 8’s sensor, and week 9 turns all of it into deadlines, replay and a safety case.
A deadline, not a speed — and a decision computed from live data before the clock runs out.
Design the system as objects and messages, and draw it before you write a line of it.
One thread, many tasks in flight — and a byte stream that has no idea where your messages end.
Frame budgets, pretrained ONNX, drop-frame versus queue-up, and fps you can actually hold.
Close the loop: perception feeds planning feeds control — then add 150 ms and watch it oscillate.
Deadlines, jitter, WCET, deterministic replay — and degrading on purpose instead of failing.
Every system in this course is the same three-stage loop under a deadline. Only the units change: microseconds for a trading bot, a 33 ms frame budget for a vision pipeline, a couple of hundred milliseconds for a security alert, a tenth of a second for a car. Pick an instance, then spend the budget: add work in decide and watch the bar push past the deadline line.
Week 1 assumes week 0 is green. Tick each step as you finish it; the lamp turns green when your environment can talk to the arena. (Ticks are kept only in this browser tab, and nothing is sent anywhere.)
No GPU, no cluster, no cloud account is needed for any week of
this course. Everything above is a pip install on a laptop, and the offline simulator
(make sim) is always an acceptable substitute for the live venue.
ConnectionRefused when the bot connectsNothing is listening on the port yet. In a lab the venue is usually started
for you; locally you start your own with make exchange.
Fix: check EXCHANGE_HOST and EXCHANGE_PORT in your
.env, and run make sim if you are offline.
The message schemas are pydantic v2 and will not import against v1.
Fix: re-run make install in a clean 3.11 venv; never mix v1 and v2 in
one environment.
onnxruntime or opencv will not installWeeks 7–8 need CPU inference wheels, and those are the ones that bite on a mixed Mac/Windows cohort.
Fix: Python 3.11 exactly, then
pip install onnxruntime opencv-python-headless — the headless build avoids the
GUI dependencies you do not need.
The team token authorises trades against your team’s capital. It belongs
in a .gitignored .env and nowhere else — not in a notebook, not in a
screenshot, not in a chat message.
Fix: git check-ignore -v .env before your first commit; if you have
already pushed one, rotate it immediately.
The handshake was accepted but under an identity the venue does not recognise, so your fills score for nobody.
Fix: TEAM_ID (and ARENA_TOKEN, when required) must match
the registered roster exactly — character for character.
make install.