{"id":17649259,"url":"https://github.com/ormanli/order-book","last_synced_at":"2025-07-26T04:10:06.434Z","repository":{"id":185203250,"uuid":"628257866","full_name":"ormanli/order-book","owner":"ormanli","description":"Order Book implementation example","archived":false,"fork":false,"pushed_at":"2024-05-25T13:50:44.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T08:41:39.310Z","etag":null,"topics":["java","java19","orderbook"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ormanli.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,"publiccode":null,"codemeta":null}},"created_at":"2023-04-15T11:45:13.000Z","updated_at":"2024-05-25T13:50:47.000Z","dependencies_parsed_at":"2025-02-05T10:42:22.752Z","dependency_job_id":"617b9c44-3964-4f65-8b9b-a62067521a03","html_url":"https://github.com/ormanli/order-book","commit_stats":null,"previous_names":["ormanli/order-book"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ormanli/order-book","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ormanli%2Forder-book","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ormanli%2Forder-book/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ormanli%2Forder-book/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ormanli%2Forder-book/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ormanli","download_url":"https://codeload.github.com/ormanli/order-book/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ormanli%2Forder-book/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267116538,"owners_count":24038624,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","java19","orderbook"],"created_at":"2024-10-23T11:25:13.823Z","updated_at":"2025-07-26T04:10:06.399Z","avatar_url":"https://github.com/ormanli.png","language":"Java","readme":"# Order Book #\n\nAn exchange allows the buyers and sellers of a product to discover each other and trade. Buyers and sellers (traders)\nsubmit orders to the exchange and the exchange applies simple rules to determine if a trade has occurred. The dominant\nkind of exchange is a central limit order book (CLOB) where orders are matched using ‘price time priority’.\n\nWhen placing an order, traders specify if they wish to buy or sell, the limit price ie. worst possible price they will\ntrade at, and the quantity (number of shares) they wish to trade. Trades only occur during the\nprocessing of a newly posted order, and happen immediately, which is known as ‘continuous trading’.\n\n### Requirements ###\n\n* Java 22+\n* Maven 3\n\n### Info ###\n\n* Application starts and creates `InputStreamReader` from `System.in` and `OutputStreamWriter` from `System.out`.\n* There two threads, first one is reading orders from `InputStreamReader` and pushing to a `LinkedBlockingQueue`.\n* Second thread is consuming orders from `LinkedBlockingQueue` and adding to `OrderBook`. If trades happen after adding\n  an order, it prints trades to `OutputStreamWriter`.\n* After both of the threads are finished, the order book is printed to `OutputStreamWriter`.\n* If an exception is thrown, application tries to process the orders to order book as much as possible.\n\n### How to create executable ###\n\n```shell\nmvn package\n```\n\n### How to run ###\n\n```shell\njava -jar ./target/orderbook-1.0-SNAPSHOT.jar \u003c ./src/test/resources/test2.txt\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Formanli%2Forder-book","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Formanli%2Forder-book","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Formanli%2Forder-book/lists"}