Skip to content

Commit 58556f2

Browse files
committed
rename cap to bound
1 parent 294426f commit 58556f2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

programs/drift/src/math/margin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn calculate_size_premium_liability_weight(
4545
imf_factor: u32,
4646
liability_weight: u32,
4747
precision: u128,
48-
is_capped: bool,
48+
is_bounded: bool,
4949
) -> DriftResult<u32> {
5050
if imf_factor == 0 {
5151
return Ok(liability_weight);
@@ -67,7 +67,7 @@ pub fn calculate_size_premium_liability_weight(
6767
)?
6868
.cast::<u32>()?;
6969

70-
if is_capped {
70+
if is_bounded {
7171
let max_liability_weight = max(liability_weight, size_premium_liability_weight);
7272
return Ok(max_liability_weight);
7373
}

programs/drift/src/state/perp_market.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,14 @@ impl PerpMarket {
506506
MarginRequirementType::Maintenance => margin_ratio_maintenance,
507507
};
508508

509-
let cap_size_premium = margin_type == MarginRequirementType::Maintenance;
509+
let bound_liability_weight = margin_type == MarginRequirementType::Maintenance;
510510

511511
let size_adj_margin_ratio = calculate_size_premium_liability_weight(
512512
size,
513513
self.imf_factor,
514514
pre_size_adj_margin_ratio,
515515
MARGIN_PRECISION_U128,
516-
cap_size_premium,
516+
bound_liability_weight,
517517
)?;
518518

519519
_calc_high_leverage_mode_initial_margin_ratio_from_size(

0 commit comments

Comments
 (0)