{"id":20828869,"url":"https://github.com/timothewt/orderbook","last_synced_at":"2025-07-18T19:32:33.837Z","repository":{"id":246975793,"uuid":"824227311","full_name":"timothewt/OrderBook","owner":"timothewt","description":"High-performance C++ Implementation of a Limit Order Book and a Matching Engine","archived":false,"fork":false,"pushed_at":"2024-07-06T17:17:47.000Z","size":17786,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T07:44:42.948Z","etag":null,"topics":["hft","high-performance","orderbook","tick-data","trading"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timothewt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-04T16:20:26.000Z","updated_at":"2025-02-28T13:27:16.000Z","dependencies_parsed_at":"2025-01-18T18:38:40.626Z","dependency_job_id":"5228ff59-a135-4dee-9dce-f806f38ffa77","html_url":"https://github.com/timothewt/OrderBook","commit_stats":null,"previous_names":["timothewt/orderbook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timothewt/OrderBook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FOrderBook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FOrderBook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FOrderBook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FOrderBook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timothewt","download_url":"https://codeload.github.com/timothewt/OrderBook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FOrderBook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265819840,"owners_count":23833553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hft","high-performance","orderbook","tick-data","trading"],"created_at":"2024-11-17T23:18:39.971Z","updated_at":"2025-07-18T19:32:33.806Z","avatar_url":"https://github.com/timothewt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Limit Order Book \u0026 Matching Engine\n\nThis repository contains the C++ implementation of a high-performance Limit Order Book and its Matching Engine.\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"50%\" src=\"demo/final_order_book.png\"\u003e \n\u003c/p\u003e\n\n## Overview\n\nThe Limit Order Book is designed using a combination of data structures to optimize order insertion, deletion, and matching:\n\n### Architecture\n\n- **Data Structures**: Orders are stored in a doubly linked-list structure, where each list represents a price level. Price levels are managed using Red-Black Trees implemented via `std::set` in C++, ensuring efficient insertion and deletion operations.\n\n- **Order Format**: Orders are added in the format `ID, AgentID, Price, Volume`, and deleted by their id `ID`.\n\n### Performance\n\nTo assess performance, the system was tested with 1,000,000 operations (place or delete orders), generated using a Python script. These operations were processed through a CSV parser and fed into the C++ program.\n\n- **High-Performance**: The system achieved a peak performance of **270,000 operations per second**. Operations include order insertions, trades, and order deletions.\n\n## Demo and Usage\n\nFor a demonstration, refer to the [Python script](demo/generate_orders.py) used to generate the orders and the corresponding CSV file. This file serves as input to the C++ program, showcasing the handling of large-scale order operations efficiently.\n\n## References\n\n1. [How to Build a Fast Limit Order Book](https://web.archive.org/web/20110410160306/http://howtohft.wordpress.com:80/2011/02/15/how-to-build-a-fast-limit-order-book) - Insights into designing performant limit order books.\n\n---\n\nThis project demonstrates a robust implementation of a Limit Order Book and Matching Engine in C++, optimized for high-frequency trading environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothewt%2Forderbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothewt%2Forderbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothewt%2Forderbook/lists"}