Skip to content

Commit 98df5c5

Browse files
committed
fix: hotfix the health factor
1 parent eeabf29 commit 98df5c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/health-computer/useHealthComputer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import { SWAP_FEE_BUFFER } from 'utils/constants'
2424
import { findPositionInAccount } from 'utils/healthComputer'
2525
import {
2626
BorrowTarget,
27+
LiquidationPriceKind,
28+
SwapKind,
2729
compute_health_js,
2830
liquidation_price_js,
29-
LiquidationPriceKind,
3031
max_borrow_estimate_js,
3132
max_perp_size_estimate_js,
3233
max_swap_estimate_js,
3334
max_withdraw_estimate_js,
34-
SwapKind,
3535
} from 'utils/health_computer'
3636
import { BN } from 'utils/helpers'
3737
import { getTokenPrice } from 'utils/tokens'
@@ -199,7 +199,7 @@ export default function useHealthComputer(account?: Account) {
199199
useEffect(() => {
200200
if (!healthComputer) return
201201
try {
202-
setHealthFactor(Number(compute_health_js(healthComputer).max_ltv_health_factor) || 10)
202+
setHealthFactor(Number(compute_health_js(healthComputer).liquidation_health_factor) || 10)
203203
} catch (err) {
204204
console.error('Failed to calculate health: ', err)
205205
}

0 commit comments

Comments
 (0)