Skip to content

Commit 58df2ff

Browse files
committed
cargo fmt --
1 parent ba10482 commit 58df2ff

File tree

11 files changed

+370
-139
lines changed

11 files changed

+370
-139
lines changed

programs/drift/src/controller/amm.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use crate::math::amm::calculate_quote_asset_amount_swapped;
1515
use crate::math::amm_spread::{calculate_spread_reserves, get_spread_reserves};
1616
use crate::math::casting::Cast;
1717
use crate::math::constants::{
18-
CONCENTRATION_PRECISION, FEE_POOL_TO_REVENUE_POOL_THRESHOLD,
19-
K_BPS_UPDATE_SCALE, MAX_CONCENTRATION_COEFFICIENT, MAX_K_BPS_INCREASE, MAX_SQRT_K,
18+
CONCENTRATION_PRECISION, FEE_POOL_TO_REVENUE_POOL_THRESHOLD, K_BPS_UPDATE_SCALE,
19+
MAX_CONCENTRATION_COEFFICIENT, MAX_K_BPS_INCREASE, MAX_SQRT_K,
2020
};
2121
use crate::math::cp_curve::get_update_k_result;
2222
use crate::math::repeg::get_total_fee_lower_bound;
@@ -726,9 +726,12 @@ pub fn update_pool_balances(
726726
min(user_unsettled_pnl, pnl_pool_token_amount.cast::<i128>()?)
727727
} else {
728728
// dont settle negative pnl to spot borrows when utilization is high (> 80%)
729-
let max_withdraw_amount =
730-
-get_max_withdraw_for_market_with_token_amount(spot_market, user_quote_token_amount, false)?
731-
.cast::<i128>()?;
729+
let max_withdraw_amount = -get_max_withdraw_for_market_with_token_amount(
730+
spot_market,
731+
user_quote_token_amount,
732+
false,
733+
)?
734+
.cast::<i128>()?;
732735

733736
max_withdraw_amount.max(user_unsettled_pnl)
734737
};

0 commit comments

Comments
 (0)