Skip to content

Commit

Permalink
use state min perp auction duration
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 29, 2024
1 parent 07fd2cf commit 898d49a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion programs/drift/src/controller/orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,7 @@ pub fn fill_perp_order(
fill_mode,
oracle_limit_order_immediately_available,
user_can_skip_duration,
state.min_perp_auction_duration as u64,
)?;

// no referrer bonus for liquidations
Expand Down Expand Up @@ -1579,6 +1580,7 @@ fn get_maker_orders_info(
fill_mode: FillMode,
oracle_limit_order_immediately_available: bool,
user_can_skip_duration: bool,
protected_maker_min_age: u64,
) -> DriftResult<Vec<(Pubkey, usize, u64)>> {
let maker_direction = taker_order.direction.opposite();

Expand Down Expand Up @@ -1707,7 +1709,7 @@ fn get_maker_orders_info(
}

if maker_order.has_oracle_price_offset() && is_protected_maker {
if !oracle_limit_order_immediately_available && !user_can_skip_duration && taker_order_age < 10 {
if !oracle_limit_order_immediately_available && !user_can_skip_duration && taker_order_age < protected_maker_min_age {
continue;
}
}
Expand Down

0 comments on commit 898d49a

Please sign in to comment.