Home /Modules/advantage/04-the-high-speed-trader.md

04-the-high-speed-trader.md

advantage/artificial-intelligence/04-the-high-speed-trader.md · 32 line(s) · markdown

Lesson 04 — The high speed trader (advanced-medium)

Series: index · prev: 03 · next: 05 — Pragmatics and evolution

Module: lib/advantage/modules/trader (see the modules README). Goal: at least 5,000 evaluations per second and about 2,000 trades per minute (roughly 0.7% of candidates), on synthetic data.

What you do

  1. Run it: sleela run HstDemo.sleela from lib/advantage/modules/trader, or load it as a module (lesson 09).
  2. Read section 2 of the output: evals/s, trades per simulated minute, vetoes by phase.
  3. Find where 99% of candidates die. Most are score rejects and logic vetoes. Why is that the right place for them to die?

Why the numbers fit together

5,000 evaluations per second at 2,000 trades per minute means about 33 trades per second, so the trader must say no about 150 times for every yes. Speed is mostly cheap rejection: hard gates first, scoring only for survivors, and a token bucket so a burst of good candidates cannot exceed the cap.

Exercises

Advanced

Make the veto path faster: reorder so the most frequent veto comes first. Measure.