diff --git a/src/Blue.sol b/src/Blue.sol index 7f84e570f..d4ac21290 100644 --- a/src/Blue.sol +++ b/src/Blue.sol @@ -230,10 +230,10 @@ contract Blue { function isHealthy(Market calldata market, Id id, address user) private view returns (bool) { uint borrowShares = borrowShare[id][user]; + if (borrowShares == 0) return true; // totalBorrowShares[id] > 0 when borrowShares > 0. - uint borrowValue = borrowShares != 0 - ? borrowShares.wMul(totalBorrow[id]).wDiv(totalBorrowShares[id]).wMul(market.borrowableOracle.price()) - : 0; + uint borrowValue = + borrowShares.wMul(totalBorrow[id]).wDiv(totalBorrowShares[id]).wMul(market.borrowableOracle.price()); uint collateralValue = collateral[id][user].wMul(market.collateralOracle.price()); return collateralValue.wMul(market.lLTV) >= borrowValue; }