Skip to main content

A high-performance order book implementation using Cython

Project description

cython-orderbook

A high-performance order book implementation in Python with Cython acceleration and price-time priority matching. Available as an official PyPI package.

Installation

pip install cython-orderbook

Features

  • Price-time priority matching engine
  • Limit and market order support
  • Order cancellation
  • Trade log with aggressor tracking
  • 670k+ matched orders/second throughput (5.4x faster than pure Python)

Usage

from cython_orderbook import OrderBook, Order, OrderSide
from decimal import Decimal

book = OrderBook()

# Add a limit order
bid = Order(side=OrderSide.BID, price=Decimal("50.00"), original_quantity=100)
book.add_limit_order(bid)

# Add a matching ask
ask = Order(side=OrderSide.ASK, price=Decimal("50.00"), original_quantity=95)
book.add_limit_order(ask)

# Add a market order (no price needed)
market_order = Order(side=OrderSide.BID, original_quantity=50)
book.add_market_order(market_order)

# Display the book before canceling remaining bid order
print(book)

# Cancel an order
book.cancel_order(bid.order_id)

# Display the book after cancelling
print(book)

# View trade log
book.print_trade_log()

Performance

Simple inserts:     ~1.49M orders/second
Matched pairs:      ~670k orders/second
Mixed actions:      ~610k orders/second

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cython_orderbook-0.1.2-cp313-cp313-win_amd64.whl (181.0 kB view details)

Uploaded CPython 3.13Windows x86-64

cython_orderbook-0.1.2-cp313-cp313-win32.whl (173.5 kB view details)

Uploaded CPython 3.13Windows x86

cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl (567.4 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_i686.whl (541.4 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

cython_orderbook-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (569.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cython_orderbook-0.1.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (535.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

cython_orderbook-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (191.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cython_orderbook-0.1.2-cp312-cp312-win_amd64.whl (181.5 kB view details)

Uploaded CPython 3.12Windows x86-64

cython_orderbook-0.1.2-cp312-cp312-win32.whl (174.0 kB view details)

Uploaded CPython 3.12Windows x86

cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl (569.6 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_i686.whl (553.2 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

cython_orderbook-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (572.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cython_orderbook-0.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (543.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

cython_orderbook-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (193.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cython_orderbook-0.1.2-cp311-cp311-win_amd64.whl (183.8 kB view details)

Uploaded CPython 3.11Windows x86-64

cython_orderbook-0.1.2-cp311-cp311-win32.whl (175.7 kB view details)

Uploaded CPython 3.11Windows x86

cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl (578.9 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_i686.whl (572.2 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

cython_orderbook-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (577.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cython_orderbook-0.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (560.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

cython_orderbook-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (193.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cython_orderbook-0.1.2-cp310-cp310-win_amd64.whl (183.8 kB view details)

Uploaded CPython 3.10Windows x86-64

cython_orderbook-0.1.2-cp310-cp310-win32.whl (175.9 kB view details)

Uploaded CPython 3.10Windows x86

cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl (554.9 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_i686.whl (546.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

cython_orderbook-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (551.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

cython_orderbook-0.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (533.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

cython_orderbook-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (194.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 aba0bb9294fce3474670a475e723844cfdbe6345be4335039674242cfb7d7378
MD5 865b37d577ec39bbd58f1ba8dd5710e6
BLAKE2b-256 58f4d4927350927fd6301a25d9eb3fcdc134bb4cca85c2a92fb7e21e434b942f

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-win32.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 02f702aef1ad0a63d07e227f084c894179ed6142b9b8552ea3ef220017f2ec67
MD5 9f4e935b7ad02cb0f506c7d043348ef5
BLAKE2b-256 a238e8ae8b0546ba0071a5674f01929019a9d787783a1c0eeb1f2bda5d045b34

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2e1ebe66f21d234f4be0304e85c3af1ddc5ba058b65ec06372cd98fab78def7c
MD5 3bb05f2c3349bbd9ef2effa003913c3b
BLAKE2b-256 6b86d47105889ef832637c9a981fb42a2bed50e112059185db941a2f1723ac01

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 8f967de877351b4a36873f4986ff1419257b02a03a6f194c67009ac5b0a13d21
MD5 144534b156d301f229157d0d76a53eef
BLAKE2b-256 c6f3d792882ddd655d958b8c3792efe6c7d3174cc4912ec5b0c5239ef2bbd57c

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a79503e4219b0df197aea11dce4ad7d38ac23dba3b8320cdf64791d787c45b4
MD5 6baa74cffe0c5100cb2fb2a88f9e75af
BLAKE2b-256 6b262e453744defcbb13c426881ea92ff6eb31e5a1358f2a7481d5b421df868f

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1d7b0eeea4090cd8ce622445e6400fca1ada235c5306702c7ddf5b32bb21c63f
MD5 7763ae71614013c1b3338450641ab646
BLAKE2b-256 0987b7c80e18025b2dc2f5f02f6683482d7ad72bd66ef140a02a0e66aa80f4c6

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4eb023c9bdaa80c7810f42522ccf173df4bb9bfc3c51cdad58d6642bf0a152e1
MD5 b7ff8ac4a60f22c02a72d05a3f298be3
BLAKE2b-256 a621d761e1da92770f11450394b99514c37a2685010a165c0f94f1e07470f5f6

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e4fc1033d9d3c1a86c1fd454113207b19bfde2751c7dd2415dcbb92f15f9d1e2
MD5 2b139a1d064ce04f5b0c2963d5cc8ee4
BLAKE2b-256 67d0e8ade74282cc6179eee758cd333726a718365e39fee2a0232251b44bff02

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 d17968de16c6e7c6d742fe4b8ddec4fc657781b3669b35467d329d1f0ceb8554
MD5 b0e16fbc93ba987dff64b8b06dba75dc
BLAKE2b-256 b63912595f877910e94b7fa59b5dd07cbd572b6bad091284302f0e14ee72c516

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 eff0f60d3408527180e26ff92d1877649aa99baed088353c485c4ed617d4cb57
MD5 4d8365a3abadbc61d22258730e3d2a0b
BLAKE2b-256 39ff10c9681d03be29870d4b380cc31e6a5a6fa0283e44caee33fe401be520c4

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 a82c3d7f265c3b34c7fa2f2397fb4bc0e58498788c60ecd87757cc497f0f69b6
MD5 2ec0aaa732add85413f3ccf183afdfd9
BLAKE2b-256 2b65ef5fe45addcb9234872fd95aeab6727a0971a6780751ea57cde7df330442

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5428ce4bd773706bfead4f9b0eeea52b2fc9d9e6026a42e494c4e4034bdc0687
MD5 d7a6c5bd77e738f00f82f8ec9c97c946
BLAKE2b-256 dec97ac92aedefcf41451b45ff2572b92fc0e7fe38654c2901d5814c1bdcc1d4

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c2b40779da90ce8bc90ae716b15b3132d7def248076c599c351b07971236adb7
MD5 a052fffdcc4b6d78e6a64650e93da6e4
BLAKE2b-256 98ab44c56ef5cc7a249328c3771a1a528dbb91dd83cffbf6942ee689bef498b4

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76bdabf9d0bfc4afe7666526ac03eef83f4b6b27e4c44f02ee820972450958dc
MD5 ec9adb038ed3f81d3bfb1fe4ca791e24
BLAKE2b-256 2ef2e2aed34244053d2a3b08a65bbb163d3bda774096268edecfa4fd8617f094

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e68851f8a78efcff08835a304b5e0493be3fd3691914d64115bbfbf15f603314
MD5 aa492e12a3815852b0392bf9cc937abc
BLAKE2b-256 5813b66a2ae8c236ae70980fe2284eed87174f8a773929dab6012adefd688455

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 2d6ec946c509937fbcd19bff6c036ad485289bab541dd925281dfda96aeb88a3
MD5 5763935ea5edc7a291d21fa32360416d
BLAKE2b-256 ddcdc3b0968583611770c472cdab8f39c2849417d8ba125294f7ea936cf76992

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 34f9ede7ce474a99a3c7b690727e49a84f092361de6834d7a78d9bba3a470010
MD5 e130da88669d8fabb119d8cd6905921d
BLAKE2b-256 a43347fce0c5e5cc4b792bba7c7b740c7c321fdec191d7df59043a6648f6beb0

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 1c6d5bfdb7d7cc172331d54befc82edcf9bda0a656109e19ecaa54d7638d5a20
MD5 b8536a10fe9da66fc6c2c45640089b9d
BLAKE2b-256 f17be8ca0daf0564caead48c28959cfb4ecdd17292e1d07d4a187bfa9cb4d3d9

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95c5dbfe435b50482afa28dbf27cc8d2488507ff0dee02d1d37e44ca1672988e
MD5 6f85b09cbe8b1bbac0b6608f57204bb7
BLAKE2b-256 80d89ee9f291f81323ba3492c1f17af7faf8f9556c7eafe5de09eb44dcd9486f

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 74bb9619eaa695daebdf7b1c61d7b14a9f48e3fd1db141fb98ec6659b24dc9e7
MD5 83bce117dfe7b0898915a59141a61319
BLAKE2b-256 686048d9e28df0f5fe68c50c1207208069ac132eb9a25af12e0ba88dc285cd1e

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 325779e120b3ea4152a8074c64f44fb6edd0cbc7a98ae98936a40f926bade385
MD5 bac9cbd2dc9f2475c51b4e4086d23bee
BLAKE2b-256 3b21ed4d8d488235135eb81c6d85a13eaef5c90b036092b9658d3f2204db2a31

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 749f2427dd20fe2df6beb4f63d5e7bf9bd8f9941c2a1b13134f32130db98b07b
MD5 44b86eb214fd3ccaa7c6e76e2f4b90bf
BLAKE2b-256 11b50947e4863817d1333b8437035f71cadaaabce6a59efe3b10d90decce7ae0

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 2d1bbabfd2d0fb5c85d34ea97f12e4b6949dadc7152d051375f39b8efbeed0b2
MD5 da6c30d44364649c8cf29544b0499b17
BLAKE2b-256 6dccec682f8b7ba208f0cf1855faa2c0f604a7632cc0dc091fc40e2f77fa4a48

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8a07acb4d5209d1a508e497263f8922dff68a784747456e519b1edfeb43db32e
MD5 1f35aa31287295dd4cc019975aa129a1
BLAKE2b-256 e97fd2d7a496699e5b9d2fa988356a2971b1324d59169ff0e123787428f56356

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 633daab7c962e7d141559eb9ccaa3aba8f1e291b5c8416f03991b08874e85c5d
MD5 6012f6b06db6afa7f061699f9e2699d5
BLAKE2b-256 439437f053ad376e5f970401fcceaddd78ee177daf98b7c9e7cf69cda8aa9fa6

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0a9f844b240aa87cd94f95a7d71db8ff2635c9da4d2803c225fb528dc456eb1
MD5 203d5e22913014a6069cbd9013c4b7c2
BLAKE2b-256 71f1f9f1632c13f6e81859799c4d069fa02670d0867b15fcb356956a518425ff

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b5bf9c08aa9ab595201bfbd925a8a7adbb4055574bd407d2762dd16b092c138e
MD5 e702dfc8391c6ea2afc1a27c74fe6323
BLAKE2b-256 42fe409af3e4299a07f6bd267b53c2e6d89a68c4d2770cb483d48ac0198149b4

See more details on using hashes here.

File details

Details for the file cython_orderbook-0.1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cython_orderbook-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7343e547349321f27983dd792bef4d67d1c86e533ddfafbf6f95cf9cc728bb2a
MD5 6bbeeaf496aee4882ce83f7bd2f5ea7f
BLAKE2b-256 a8ff32f05c467d539c30bfe4f40629c173b908414662e2cd25df0af736c5821b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page