{"id":17339976,"url":"https://github.com/resetius/orderbook","last_synced_at":"2025-03-27T08:25:24.716Z","repository":{"id":234919418,"uuid":"789736538","full_name":"resetius/orderbook","owner":"resetius","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-21T14:24:50.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T13:25:31.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/resetius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-04-21T12:20:52.000Z","updated_at":"2024-04-21T14:24:53.000Z","dependencies_parsed_at":"2024-04-21T14:55:39.217Z","dependency_job_id":"3c5ff9dd-583b-40f5-b47a-ed4c0bddb9cb","html_url":"https://github.com/resetius/orderbook","commit_stats":null,"previous_names":["resetius/orderbook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resetius%2Forderbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resetius%2Forderbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resetius%2Forderbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resetius%2Forderbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/resetius","download_url":"https://codeload.github.com/resetius/orderbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245807802,"owners_count":20675615,"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":[],"created_at":"2024-10-15T15:43:39.831Z","updated_at":"2025-03-27T08:25:24.690Z","avatar_url":"https://github.com/resetius.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orderbook Implementations\n\nThis project includes two implementations of an orderbook: one using `priority_queue` and another using `multiset`. The corresponding classes are `ExchangePq` for the `priority_queue` implementation, and `ExchangeMultiset` for the `multiset` implementation.\n\n## Features\n\n- **ExchangePq**: Implements the orderbook using `std::priority_queue`. This implementation is optimized for operations that frequently access the top element but might be slower for mid-container operations.\n  \n- **ExchangeMultiset**: Utilizes `std::multiset` to manage the orderbook, providing efficient handling and flexibility for insertion and deletion across the entire data structure.\n\n## Usage\n\nSee `exchange_test.cpp` for examples and test cases illustrating how to use both implementations.\n\n### Adding Orders\n\nTo add a bid or ask order to the orderbook, use the `add` method:\n\n```cpp\nexchangePq.add(orderId, orderSide, orderPrice, orderQuantity);\nexchangeMultiset.add(orderId, orderSide, orderPrice, orderQuantity);\n```\n\n### Removing Orders\n\nTo remove an order from the orderbook, use the `erase` method:\n\n```cpp\nexchangePq.erase(orderId);\nexchangeMultiset.erase(orderId);\n```\n\n## Building\n\nThe project is set up to use `cmake` for building. Follow these steps to compile:\n\n1. Create a build directory:\n\n   ```bash\n   mkdir build\n   cd build\n   ```\n\n2. Run CMake and make:\n\n   ```bash\n   cmake ..\n   make\n   ```\n\n3. Run the tests (optional):\n\n   ```bash\n   ./exchange_test\n   ```\n\nFor more information on how to set up and run the tests, refer to the documentation in `exchange_test.cpp`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresetius%2Forderbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresetius%2Forderbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresetius%2Forderbook/lists"}