clob-sync 0.1.1

A synchronous, high-performance Central Limit Order Book implementation in Rust featuring an in-memory architecture with zero-cost abstractions and type-safe financial primitives for ultra-low latency trading applications.
docs.rs failed to build clob-sync-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: clob-sync-0.1.2

CLOB-Sync

crates.io docs.rs License Downloads MSRV

A synchronous, high-performance Central Limit Order Book implementation in Rust featuring an in-memory architecture with zero-cost abstractions and type-safe financial primitives for ultra-low latency trading applications.

CLOB

A CLOB is composed of two priority queues: asks (limit sell orders ordered low to high) and bids (limit buy orders ordered high to low). Orders at the same price are FIFO.

Price
  ^
  |     +---------+
  |     | $102 C  |  ← Worst Ask
  |     | $101 B  |
  |     | $100 A  |  ← Best Ask (lowest)
  |     +---------+
  |      spread
  |     +---------+
  |     | $99  X  |  ← Best Bid (highest)
  |     | $98  Y  |
  |     | $97  Z  |  ← Worst Bid
  |     +---------+
  +--------------------------> Quantity

Order Behavior

  • Limit orders: Not allowed to cross spread (buy price >= best ask, sell price <= best bid). Rests on book otherwise.
  • Market orders: Execute immediately at best price. Partial fills when liquidity insufficient.

Installation

Add this to your Cargo.toml:

[dependencies]
clob-sync = "0.1.1"

Or use cargo add:

cargo add clob-sync

Development

  1. Clone the repository:
git clone git@github.com:jfaleiro/clob-sync.git
cd clob-sync
  1. Install git hooks:
make setup

Main development tasks are executed as a result of git commit and git push.

Commit messages are validated during commit-msg phase of git hook and must be compatible with Conventional Commits.

License

This project is licensed under the GNU Lesser General Public License v2.1 (LGPL-2.1). See the LICENSE file for details.