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/index.html

Module ObookSource

Obook: Zero-Allocation L3 Limit Order Book, 128-Bit Fixed-Point Math, ITCH 5.0 Wire Codec, and Streaming Microstructure Analytics.

Sourcemodule Fixed : sig ... end

Fixed-point 64-bit arithmetic scaled by 10^8 (1 satoshi / 1 pipette). Uses 128-bit intermediate math so multiplying $100k by 1,000 BTC doesn't vaporize your portfolio in an int64 overflow.

Sourcemodule Stats : sig ... end

Streaming O(1) market microstructure & statistical indicators. No sliding arrays eating RAM, no catastrophic float cancellation.

Sourcemodule Arena : sig ... end

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.

Sourcemodule Book : sig ... end

Zero-allocation L3 Limit Order Book & Matching Engine. Supports GTC, IOC, FOK (with read-only pre-scan), Post-Only, Iceberg orders, Self-Trade Prevention (STP), O(1) cancel/amend, and integrated streaming quant stats.

Sourcemodule Itch : sig ... end

Zero-copy NASDAQ TotalView-ITCH 5.0 binary wire codec & book driver. Reads big-endian network frames straight out of a bytes buffer without allocating intermediate strings on the hot path.

Sourcemodule Ez : sig ... end

Batteries-included ergonomic wrapper for Obook. Zero ceremony: pass floats, get auto-assigned order IDs, grab JSON or pretty ASCII depth tables in one line.

Sourceval book : ?capacity:int -> ?stp:Book.stp_mode -> ?vpin_bucket_vol:float -> ?vpin_buckets:int -> string -> Ez.t
Sourceval bid : Ez.t -> ?id:int -> ?trader:int -> ?tif:Book.tif -> ?iceberg:float -> px:float -> qty:float -> unit -> int * Book.exec_report
Sourceval ask : Ez.t -> ?id:int -> ?trader:int -> ?tif:Book.tif -> ?iceberg:float -> px:float -> qty:float -> unit -> int * Book.exec_report
Sourceval buy_mkt : Ez.t -> ?id:int -> ?trader:int -> qty:float -> unit -> Book.exec_report
Sourceval sell_mkt : Ez.t -> ?id:int -> ?trader:int -> qty:float -> unit -> Book.exec_report
Sourceval cancel : Ez.t -> int -> bool
Sourceval amend : Ez.t -> id:int -> px:float -> qty:float -> bool
Sourceval snap : Ez.t -> Ez.snap
Sourceval pp : ?levels:int -> Ez.t -> unit