Skip to content

Commit

Permalink
cargo fmt --
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 12, 2024
1 parent 79e0f27 commit 219ab32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 12 additions & 9 deletions programs/drift/src/instructions/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ use crate::state::user_map::{load_user_map, load_user_maps, UserMap, UserStatsMa
use crate::validation::sig_verification::{extract_ed25519_ix_signature, verify_ed25519_digest};
use crate::validation::user::validate_user_is_idle;
use crate::{
controller, digest_struct, load, math, print_error, OracleSource, GOV_SPOT_MARKET_INDEX, MARGIN_PRECISION,
controller, digest_struct, load, math, print_error, OracleSource, GOV_SPOT_MARKET_INDEX,
MARGIN_PRECISION,
};
use crate::{load_mut, QUOTE_PRECISION_U64};
use crate::{validate, QUOTE_PRECISION_I128};
Expand Down Expand Up @@ -2077,14 +2078,16 @@ pub fn handle_disable_user_high_leverage_mode<'c: 'info, 'info>(

user.margin_mode = MarginMode::Default;

let meets_margin_requirement_with_buffer = calculate_margin_requirement_and_total_collateral_and_liability_info(
&user,
&perp_market_map,
&spot_market_map,
&mut oracle_map,
MarginContext::standard(MarginRequirementType::Initial).margin_buffer(MARGIN_PRECISION / 100), // 1% buffer
)
.map(|calc| calc.meets_margin_requirement_with_buffer())?;
let meets_margin_requirement_with_buffer =
calculate_margin_requirement_and_total_collateral_and_liability_info(
&user,
&perp_market_map,
&spot_market_map,
&mut oracle_map,
MarginContext::standard(MarginRequirementType::Initial)
.margin_buffer(MARGIN_PRECISION / 100), // 1% buffer
)
.map(|calc| calc.meets_margin_requirement_with_buffer())?;

validate!(
meets_margin_requirement_with_buffer,
Expand Down
1 change: 0 additions & 1 deletion programs/drift/src/math/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ pub fn calculate_fee_for_fulfillment_with_amm(
fee = fee.safe_mul(2)?;
}


let (fee, referee_discount, referrer_reward) = if reward_referrer {
calculate_referee_fee_and_referrer_reward(
fee,
Expand Down

0 comments on commit 219ab32

Please sign in to comment.