Skip to content

Commit

Permalink
dont subtract taker fees in post only orders
Browse files Browse the repository at this point in the history
  • Loading branch information
skrrb committed Nov 29, 2023
1 parent 78412da commit 3268f06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions programs/openbook-v2/src/state/orderbook/book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ impl<'a> Orderbook<'a> {
// matched_changes/matched_deletes and then applied after this loop.

let order_max_base_lots = order.max_base_lots;
let order_max_quote_lots = match side {
Side::Bid => market.subtract_taker_fees(order.max_quote_lots_including_fees),
Side::Ask => order.max_quote_lots_including_fees,
let order_max_quote_lots = if side == Side::Bid && !post_only {
market.subtract_taker_fees(order.max_quote_lots_including_fees)
} else {
order.max_quote_lots_including_fees
};

require_gte!(
Expand Down

0 comments on commit 3268f06

Please sign in to comment.