Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public API to iterate over L2/L3 data #216

Closed
wants to merge 3 commits into from

Conversation

tommyip
Copy link

@tommyip tommyip commented Feb 6, 2022

Fixes #208

@tommyip
Copy link
Author

tommyip commented Feb 6, 2022

Usage:

use serum_dex::utils::{OrderBook, Level};

let bids_slab = market_state.load_bids_mut(&bids_account_info)?;
let orderbook = OrderBook::new(Side::Bid, &bids_slab);

let eg1 = orderbook.levels();
let eg2: Vec<Level> = orderbook.levels().take(10).collect();

@dovahcrow
Copy link

Can we have Default derived for Level?

@tommyip
Copy link
Author

tommyip commented Apr 17, 2022

Added. The maintainers doesn't seem to be interested in this PR though.

@dovahcrow
Copy link

Added. The maintainers doesn't seem to be interested in this PR though.

Thank you! Yeah I hope this PR can be merged soon. I've been using your branch for a long time. It is very useful! I appreciate your work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add public API to iterate over L2/L3 data
2 participants