Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions programs/openbook-v2/src/state/orderbook/book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ impl<'a> Orderbook<'a> {
// generate new order id
let order_id = market.gen_order_id(side, price_data);

// Iterate through book and match against this new order.
//
// Any changes to matching orders on the other side of the book are collected in
// matched_changes/matched_deletes and then applied after this loop.

let order_max_base_lots = order.max_base_lots;
let order_max_quote_lots = if side == Side::Bid && !post_only {
market.subtract_taker_fees(order.max_quote_lots_including_fees)
Expand All @@ -115,6 +110,10 @@ impl<'a> Orderbook<'a> {
let mut referrer_amount = 0_u64;
let mut maker_rebates_acc = 0_u64;

// Iterate through book and match against this new order.
//
// Any changes to matching orders on the other side of the book are collected in
// matched_order_changes/matched_order_deletes and then applied after this loop.
let mut matched_order_changes: Vec<(BookSideOrderHandle, i64)> = vec![];
let mut matched_order_deletes: Vec<(BookSideOrderTree, u128)> = vec![];
let mut number_of_dropped_expired_orders = 0;
Expand Down