Closed ian-wazowski closed 1 month ago
As the name suggests, ROIVectorMarketDepth focuses on a specific range of the market depth. Therefore, you need to set your Range of Interest, which is usually around the mid-price. On the other hand, HashMapMarketDepth maintains the full market depth information.
Please see the Working with Market Depth and Trades. The following tutorials also use ROIVectorMarketDepth
.
As the name suggests, ROIVectorMarketDepth focuses on a specific range of the market depth. Therefore, you need to set your Range of Interest, which is usually around the mid-price. On the other hand, HashMapMarketDepth maintains the full market depth information. Please see the Working with Market Depth and Trades. The following tutorials also use
ROIVectorMarketDepth
.
Great! I guess I was misunderstanding the whole structure, I will refer to the example above for the part about creating partial snapshots, and focus on the other parts of the framework.
Thanks for your kind reply.
In #112, I decided to give a little more thought to functions that take snapshots in
BTreeMarketDepth
,FusedHashMapMarketDepth
, andHashMapMarketDepth
because the cost of copying the Vec is too high.However, since
ROIVectorMarketDepth
is internally managed bydepth: Vec<f64>
, it can be cost-effectively fetched via slice.Therefore, why not guide users who use the ability to take snapshots down to order book level L to use the performance-optimised
ROIVectorMarketDepth
?Why not have an expensive implementation inside
BTreeMarketDepth
,FusedHashMapMarketDepth
, andHashMapMarketDepth
?Translated with www.DeepL.com/Translator (free version)