Skip to content

Commit

Permalink
Liquidator: fix an arithmetic error in client side health computation (
Browse files Browse the repository at this point in the history
  • Loading branch information
farnyser authored Aug 5, 2024
1 parent 70bf435 commit f5b4bd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion programs/mango-v4/src/health/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,10 @@ fn scan_right_until_less_than(
if value <= target {
return Ok(current);
}
current = current.max(I80F48::ONE) * I80F48::from(2);
let Some(new_current) = current.max(I80F48::ONE).checked_mul(I80F48::from(2)) else {
break;
};
current = new_current;
}
Err(error_msg!(
"could not find amount that lead to health ratio <= 0"
Expand Down

0 comments on commit f5b4bd9

Please sign in to comment.