newsfilter.io
Lecture, Conference Presentation

Caml Trading

  • Jane Street Capital transitioned from mainstream languages (VB, C#, Java, C++) to OCaml as its primary development language over the last several years, despite OCaml's "comically unpopular" status in the wider industry.
  • The firm is a proprietary trading company with ~190 employees, operating offices in New York, London, Tokyo, and Chicago, with approximately 35 staff members primarily writing OCaml.
  • Jane Street does not act as an investor or speculator; its business model focuses on market making and arbitrage, aiming to profit from tight spreads and liquidity provision rather than long-term price prediction.
  • The firm trades 200–400 million shares daily in U.S. equity markets alone, representing 1–2% of all domestic equity trades, with $4–8 billion in nominal value flowing through their systems daily.
  • Critical technology requirements for the firm include absolute correctness (to prevent rapid capital loss), extreme agility (to adapt to changing markets, regulations, and exchanges), and high performance (to minimize hardware management costs and human labor).
  • Jane Street's commitment to correctness is rooted in a culture where partners personally read every line of critical trading code, prioritizing code readability over raw feature density.
  • OCaml facilitates correctness and readability through "brevity" (reducing boilerplate and verbosity) and a powerful type system that offloads proof obligations to the compiler.
  • Algebraic data types (ADTs) with match statements provide static exhaustiveness checks, automatically warning developers when new data variants are added to a type but not handled in existing logic.
  • The firm handles ~1TB of raw data daily, requiring high-performance code generation to manage infrastructure costs and human resource constraints rather than simply purchasing more hardware.
  • OCaml offers a "sweet spot" in language design by balancing high-level declarative expressiveness with efficient native code compilation, avoiding the performance unpredictability of SQL or the verbosity of Java.
  • Identified limitations of OCaml include a lack of robust user interface libraries, no built-in physical parallelism (requiring multi-process management), a small external library ecosystem, and immature tooling for "programming in the large" (namespaces, packaging).
  • To address community gaps, Jane Street established the "Jane Street Summer Project" (formerly OCaml Summer Project), funding students and faculty to build practical infrastructure like UI libraries and concurrency tools for functional languages.
  • The adoption of OCaml significantly improved hiring outcomes, yielding a high ratio of qualified candidates and attracting top-tier engineers who are comfortable with static typing and functional paradigms.
  • Jane Street rejected Microsoft's F# as an alternative due to its poor performance on symbolic code (high allocation rates), the persistence of null pointer issues when interop-ing with .NET, and the lack of powerful abstraction tools like functors.
  • The transition to OCaml was not a "Big Bang" decision but an evolutionary process driven by a single engineer's experimental prototypes that demonstrated superior maintainability and speed.
  • The firm maintains a monolithic codebase (one massive repository) rather than splitting into modular components, leveraging OCaml's strength in handling large-scale systems without complex build systems.