百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lobster

> 编程语言
开源

快速入室限制订购书(LOB).

176 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

快速入室限制订购书(LOB).

Quickstart

To use Lobster, create an order book instance with default parameters, and send orders for execution:

…

Lobster only deals in integer price points and quantities. Prices and quantities are represented as unsigned 64-bit integers. If the traded instrument supports fractional prices and quantities, the conversion needs to be handled by the user. At this time, Lobster does not support negative prices.

More information can be found in the documentation.

Quantcup

The winning quantcup submission is at the moment up to 10x faster than Lobster. While Lobster can surely be improved significantly, some design choices by necessity make it slower. Here's a non-exhaustive list:

  1. The Quantcup solution holds all the possible price points in memory, whereas Lobster uses two BTreeMap structs that hold price points on demand. The performance boost of holding all the price points in a contiguous data structure on the stack is massive, but it's not very practical: the array is indexed by the price, so it can be huge (imagine implementing an order book for forex markets with integer price points at all non-fractional values); in reality limit orders can be made at any price, and in most markets there is no upper bound, so the static array solution is not viable.

  2. The Quantcup solution does not update the max bid/min ask values when canceling orders. So if an order at the best bid/ask is canceled, that solution will not be correct. To be fair, this is pretty trivial to fix, but nonetheless it wasn't done in the benchmarked winning solution.

  3. The Quantcup solution does not accept external order IDs; instead it provides them as integer indices from a static array. This has obvious practical consequences: the order book can handle a maximum number of open orders, and that number is chosen at compile time. Furthermore, if order IDs are not known to the sender before executing the order, it's difficult to broadcast the events to the right sender. Lobster supports unsigned 128-bit integers as order IDs, which can thus contain v4 UUIDs.

Todo

  1. Remove OrderBook::update_min_ask and OrderBook::update_max_bid and instead update the min ask/max bid values only when needed. Currently those methods are called on every order execution, and flamegraph analysis confirms that they are the main bottleneck.
  2. Experiment with replacing BTreeMaps with Trie from qp_trie.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustalgotradinghftorderbook

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言