1.2.4 • Published 1 year ago
orderbook-match-test v1.2.4
const OrderBook = require("orderbook-match-test")
\
Order matching
How to use
const exchange = OrderBook("my-symbol");
exchange.add_order({ order_type: "buy", quantity: 100, order_price: 150.5 });
\
exchange.add_order({ order_type: "sell", quantity: 50, order_price: 100.75 });
\
exchange.add_order({ order_type: "sell", quantity: 50, order_price: 10.25 });
\
exchange.add_order({ order_type: "buy", quantity: 50, order_price: 150.25 });
To get latest price
const latestPrice = exchange.price
Happy Coding :)