Closed loongmxbt closed 3 months ago
Hi, just to understand what the use case of this feature would be? At the moment, you need to keep track of the responses received from the order book for each order.
@fasenderos Hi, I want to have a sheduler to get the latest price every 1s or 5s, and send them to subscribers. and I thought I have to get the latest price from the orderbook snapshot.
The snapshot isn’t intended for that, and calling every second or so can potentially degrade the order book performance.
At the moment, you need to keep track of the responses received from the order book for each order, however I’m working on new features and one of them expose the market price of the order book.
@fasenderos Thanks for your answer! Now I'm gonna use a tsdb or memory-db to store the latest trade price and sequence, and client subscribe the current price from the db. And when the trading ends, move the tick level series data to postgres/mysql.
@loongmxbt v6.1.0-beta.0
now has a new property lob.marketPrice
for getting the current market price.
Thanks a lot! I'll try out the new version. 😄
Hi, I'm new to orderbook. How can I get the latest price and historical trades from the orderbook. I've checked
lob.snapshot();
and seems no last trade price inside it. Thanks in advance!