Skip to content

Commit

Permalink
Replace checked_multiply_ratio with checked_mul_floor
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll committed Aug 7, 2024
1 parent d8a47d4 commit b7664d0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions smart-contracts/osmosis/contracts/cl-vault/src/vault/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,12 @@ pub fn do_swap_deposit_merge(
}

let (balance0, balance1) = (
tokens_provided.0.checked_multiply_ratio(
ratio_of_swappable_funds_to_use.numerator(),
ratio_of_swappable_funds_to_use.denominator(),
)?,
tokens_provided.1.checked_multiply_ratio(
ratio_of_swappable_funds_to_use.numerator(),
ratio_of_swappable_funds_to_use.denominator(),
)?,
tokens_provided
.0
.checked_mul_floor(ratio_of_swappable_funds_to_use)?,
tokens_provided
.1
.checked_mul_floor(ratio_of_swappable_funds_to_use)?,
);

let mut target_range_position_ids = vec![];
Expand Down

0 comments on commit b7664d0

Please sign in to comment.