Skip to content

Commit

Permalink
program: use dynamic liquidator fee for liqudiate_perp
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 21, 2024
1 parent f0e0e6b commit e9ea799
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion programs/drift/src/controller/liquidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ pub fn liquidate_perp(
let quote_oracle_price = oracle_map
.get_price_data(&quote_spot_market.oracle_id())?
.price;
let liquidator_fee = market.liquidator_fee;

let liquidator_fee = get_liquidation_fee(
market.liquidator_fee,
market.get_max_liquidation_fee()?,
user.last_active_slot,
slot,
)?;

let if_liquidation_fee = calculate_perp_if_fee(
intermediate_margin_calculation.tracked_market_margin_shortage(margin_shortage)?,
user_base_asset_amount,
Expand Down

0 comments on commit e9ea799

Please sign in to comment.