serum-dex icon indicating copy to clipboard operation
serum-dex copied to clipboard

Add public API to iterate over L2/L3 data

Open tommyip opened this issue 3 years ago • 2 comments

Currently the serum_dex crate does not expose any public API to iterate over the order book. It is possible to do it by repeatedly calling find_min/max() and remove_by_key() on the slap as it is done by the matching engine, but this depends on implementation detail and require unnecessary mutation.

I saw that the serum-ts library exposes a slab.items() generator as well as a getL2 method. Can we add a similar functionality to the Rust crate?

I can implement it if the request is approved.

tommyip avatar Dec 24 '21 06:12 tommyip

I would love to see an example to get a proper order book struct starting with currents load_bids_mut.

gitmalong avatar Jan 16 '22 12:01 gitmalong

100% me too.

sthornington avatar Feb 06 '22 01:02 sthornington