package obook

Build not yet checked
  1. Overview
  2. Docs
Zero-allocation L3 limit order book and streaming HFT math in pure OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.0.0.tar.gz
sha256=059c1cd865ee1364e685dd57b1be0f8dd8b6feaa129c62e25f4673cbb8b2ab15
sha512=830508c1acfb828b30367715cd3e531e08a2404b7163f8da9b4347dc35a326321c1cc3bb05ee5c5e7f723064c68b00257b2dc551d1014d15e3ff03ed5a3a8e5c

doc/obook/Obook/Arena/index.html

Module Obook.ArenaSource

Zero-allocation flat order arena + open-addressed O(1) ID lookup table. Because triggering a GC collection in the matching hot path is a great way to donate alpha to faster counterparties.

Sourcetype side =
  1. | Bid
  2. | Ask
Sourcetype t
Sourceval null : int
Sourceval create : capacity:int -> t
Sourceval clear : t -> unit
Sourceval capacity : t -> int
Sourceval active_count : t -> int
Sourceval alloc : t -> id:int -> trader:int -> side:side -> px:Fixed.t -> disp_qty:Fixed.t -> hid_qty:Fixed.t -> peak_qty:Fixed.t -> ts:int64 -> (int, [> `Duplicate_id | `Arena_full ]) result
Sourceval free : t -> int -> unit
Sourceval find_slot : t -> int -> int
Sourceval is_alive : t -> int -> bool
Sourceval id : t -> int -> int
Sourceval trader : t -> int -> int
Sourceval side : t -> int -> side
Sourceval px : t -> int -> Fixed.t
Sourceval disp_qty : t -> int -> Fixed.t
Sourceval hid_qty : t -> int -> Fixed.t
Sourceval peak_qty : t -> int -> Fixed.t
Sourceval total_qty : t -> int -> Fixed.t
Sourceval ts : t -> int -> int64
Sourceval prev : t -> int -> int
Sourceval next : t -> int -> int
Sourceval level_idx : t -> int -> int
Sourceval set_px : t -> int -> Fixed.t -> unit
Sourceval set_disp_qty : t -> int -> Fixed.t -> unit
Sourceval set_hid_qty : t -> int -> Fixed.t -> unit
Sourceval set_ts : t -> int -> int64 -> unit
Sourceval set_prev : t -> int -> int -> unit
Sourceval set_next : t -> int -> int -> unit
Sourceval set_level_idx : t -> int -> int -> unit