VLLimitOrderBook.jl is a package written in Julia that simulates order book dynamics and matching for equities, options, and cryptocurrency orders. The orders in the book are stored in an AVL Tree data structure and prioritized based on price and time.
An order book is an electronic list of buy and sell orders for a specific security. Order books, which are maintained for each security traded on an exchange, catalog orders based upon the time and price the entry was received and use different matching algorithms to match buyers and sellers for a particular security. , which can also be used to help illustrate the dynamics for that security. Thus, order books, and their associated matching algorithms, play an essential role in determining the price at which a trade is executed. Order books can also be used as a measure of the supply and demand dynamics for a security.
The following section will briefly discuss this package's origins and how we modified and extended its features. Finally, we will provide a system evaluation and validation.
Where does this package come from? This package is based on LimitOrderBook.jl, which previously implemented the submission and cancellation of market orders and limit orders. It also provided information regarding the order book, such as the depth of the book, total bid/ask volume, and best bid/ask prices. However, several things could have been improved with the original package. Toward these issues, we fixed several order matching and account tracking issues present in the original package. Further, we extended the package to include additional order types, such as stop-loss orders and buy-stop orders. We also implemented functionality to load or persist the state of the entire order book as a comma-separated value (CSV) file. Finally, we are working on functionality to integrate the book with the order submission process. A notification feature is being added to notify the client/broker regarding order status; for example, when a limit order is submitted, it may only get matched after some time. If matched, the matching engine will notify listeners that the limited order has been executed.
How do we maintain this package? VLLimitOrderBook.jl is maintained on the Varnerlab GitHub site at Cornell University. The code is available under an MIT software license.
Evaluation and Validation We are implementing a set of performance benchmarks. We measure throughput by submitting or canceling orders concurrently or sequentially. We also measure the time required to process an order from submission to completion of the matching process. Finally, to validate the accuracy and correctness of the order book simulation, we are working with Polygon, a leading market data provider, to compare simulated historical book data for a variety of assets, including equity, options, and cryptocurrency.