Skip to content

Commit

Permalink
dont iterate to find open bids
Browse files Browse the repository at this point in the history
  • Loading branch information
skrrb committed Jul 14, 2023
1 parent e4bd946 commit 9752024
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions programs/openbook-v2/src/instructions/settle_funds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ pub fn settle_funds<'info>(ctx: Context<'_, '_, '_, 'info, SettleFunds<'info>>)

let mut roundoff_maker_fees = 0;

if market.maker_fee.is_positive()
&& !open_orders_account
.all_orders_in_use()
.any(|oo| oo.side_and_tree().side() == Side::Bid)
{
if market.maker_fee.is_positive() && open_orders_account.position.bids_base_lots == 0 {
roundoff_maker_fees = open_orders_account.position.locked_maker_fees;
open_orders_account.position.locked_maker_fees = 0;
}
Expand Down

0 comments on commit 9752024

Please sign in to comment.