Skip to content

Commit

Permalink
Filter out partially fillable orders which have been filled completely
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Apr 7, 2022
1 parent e73b207 commit 2fc25c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/orderbook/src/solvable_orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ fn solvable_orders(mut orders: Vec<Order>, balances: &Balances) -> Vec<Order> {
// that we first need a way to communicate this to the solver. We could repurpose
// availableBalance for this.
let needed_balance = match max_transfer_out_amount(&order) {
// Should only every happen if a partially fillable order has been filled completely
Ok(balance) if balance.is_zero() => continue,
Ok(balance) => balance,
Err(err) => {
// This should only happen if we read bogus order data from
Expand Down

0 comments on commit 2fc25c9

Please sign in to comment.