orderbook
OrderBook
A simple orderbook written in crystal. It currently supports FIFO matching.
Usage
# create a book
orderbook = OrderBook::Book.new
# add orders
order_1 = OrderBook::Order.new(OrderBook::Type::SELL, OrderBook::OrderType::LIMIT, 5, 100.5)
order_2 = OrderBook::Order.new(OrderBook::Type::BUY, OrderBook::OrderType::LIMIT, 10, 100.5)
order_3 = OrderBook::Order.new(OrderBook::Type::SELL, OrderBook::OrderType::MARKET, 5)
orderbook << order_1
orderbook << order_2
orderbook << order_3
# display bids
orderbook.disp_bids
# display asks
orderbook.disp_asks
Contributing
- Fork it (https://github.com/unullable/orderbook/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- unullable - creator and maintainer
Repository
orderbook
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 21 days ago
- November 5, 2025
License
MIT License
Links
Synced at
Thu, 27 Nov 2025 04:27:42 GMT
Languages