Skip to content

Commit 35a282b

Browse files
committed
repay floor to ceil hotfix
1 parent f960664 commit 35a282b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

token-lending/program/src/state/reserve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl Reserve {
250250
}
251251
Ordering::Less => {
252252
let withdraw_pct = liquidation_value.try_div(collateral.market_value)?;
253-
repay_amount = max_amount.try_floor_u64()?;
253+
repay_amount = max_amount.try_ceil_u64()?;
254254
withdraw_amount = Decimal::from(collateral.deposited_amount)
255255
.try_mul(withdraw_pct)?
256256
.try_floor_u64()?;
@@ -282,7 +282,7 @@ impl Reserve {
282282
Ordering::Less => {
283283
let withdraw_pct = liquidation_value.try_div(collateral.market_value)?;
284284
settle_amount = liquidation_amount;
285-
repay_amount = settle_amount.try_floor_u64()?;
285+
repay_amount = settle_amount.try_ceil_u64()?;
286286
withdraw_amount = Decimal::from(collateral.deposited_amount)
287287
.try_mul(withdraw_pct)?
288288
.try_floor_u64()?;

0 commit comments

Comments
 (0)