diff --git a/src/components/Modals/HLS/Deposit/useAccordionItems.tsx b/src/components/Modals/HLS/Deposit/useAccordionItems.tsx index 4852eaf4..72c5fddc 100644 --- a/src/components/Modals/HLS/Deposit/useAccordionItems.tsx +++ b/src/components/Modals/HLS/Deposit/useAccordionItems.tsx @@ -19,7 +19,7 @@ import { getDepositCapMessage, getHealthFactorMessage, getLiquidityMessage, - getNoBalanceMessage, + getNoBalanceInWalletMessage, } from 'utils/messages' interface Props { @@ -69,7 +69,7 @@ export default function useAccordionItems(props: Props) { const collateralWarningMessages = useMemo(() => { const messages: string[] = [] if (!props.walletCollateralAsset?.amount) { - messages.push(getNoBalanceMessage(props.collateralAsset.symbol)) + messages.push(getNoBalanceInWalletMessage(props.collateralAsset.symbol)) } if (props.depositAmount.isGreaterThan(depositCapLeft)) { diff --git a/src/components/Modals/HLS/Manage/Deposit.tsx b/src/components/Modals/HLS/Manage/Deposit.tsx index ca54dcb6..5dd91547 100644 --- a/src/components/Modals/HLS/Manage/Deposit.tsx +++ b/src/components/Modals/HLS/Manage/Deposit.tsx @@ -25,7 +25,7 @@ import { getDepositCapMessage, getHealthFactorMessage, getLiquidityMessage, - getNoBalanceMessage, + getNoBalanceInWalletMessage, } from 'utils/messages' interface Props { @@ -87,7 +87,7 @@ export default function Deposit(props: Props) { } if (collateralAssetAmountInWallet.isZero()) { - messages.push(getNoBalanceMessage(props.collateralAsset.symbol)) + messages.push(getNoBalanceInWalletMessage(props.collateralAsset.symbol)) } return messages diff --git a/src/components/Modals/HLS/Manage/Repay.tsx b/src/components/Modals/HLS/Manage/Repay.tsx index 7649e3de..62da7f47 100644 --- a/src/components/Modals/HLS/Manage/Repay.tsx +++ b/src/components/Modals/HLS/Manage/Repay.tsx @@ -11,7 +11,7 @@ import useStore from 'store' import { BNCoin } from 'types/classes/BNCoin' import { byDenom } from 'utils/array' import { BN } from 'utils/helpers' -import { getNoBalanceMessage } from 'utils/messages' +import { getNoBalanceInWalletMessage } from 'utils/messages' interface Props { account: Account @@ -83,7 +83,7 @@ export default function Repay(props: Props) { const warningMessages = useMemo(() => { if (borrowAssetAmountInWallet.isZero()) { - return [getNoBalanceMessage(props.borrowAsset.symbol)] + return [getNoBalanceInWalletMessage(props.borrowAsset.symbol)] } return [] }, [borrowAssetAmountInWallet, props.borrowAsset.symbol]) diff --git a/src/hooks/useHealthComputer.tsx b/src/hooks/useHealthComputer.tsx index 995ee3ae..bd1a1feb 100644 --- a/src/hooks/useHealthComputer.tsx +++ b/src/hooks/useHealthComputer.tsx @@ -56,15 +56,17 @@ export default function useHealthComputer(account?: Account) { base_coin: { amount: '0', // Not used by healthcomputer denom: curr.denoms.lp, - value: curr.amounts.unlocking.times(baseCoinPrice).integerValue().toString(), + value: curr.amounts.unlocking + .plus(curr.amounts.unlocked) + .times(baseCoinPrice) + .integerValue() + .toString(), }, vault_coin: { amount: '0', // Not used by healthcomputer denom: curr.denoms.vault, value: curr.values.primary .plus(curr.values.secondary) - .plus(curr.values.unlocking) - .plus(curr.values.unlocked) .shiftedBy(VALUE_SCALE_FACTOR + 6) // Need to scale additional 6 to correct for uusd values .integerValue() .toString(), diff --git a/src/utils/health_computer/index_bg.wasm b/src/utils/health_computer/index_bg.wasm index 60e6776c..9afb93c6 100644 Binary files a/src/utils/health_computer/index_bg.wasm and b/src/utils/health_computer/index_bg.wasm differ diff --git a/src/utils/messages.ts b/src/utils/messages.ts index 1f269788..c6da505b 100644 --- a/src/utils/messages.ts +++ b/src/utils/messages.ts @@ -4,6 +4,10 @@ export function getNoBalanceMessage(symbol: string) { return `You don't have an ${symbol} balance in your account.` } +export function getNoBalanceInWalletMessage(symbol: string) { + return `You don't have any ${symbol} in your wallet.` +} + export function getDepositCapMessage( denom: string, amount: BigNumber, @@ -30,5 +34,5 @@ export function getHealthFactorMessage( return `You cannot ${action} more than ${formatAmountWithSymbol({ denom, amount: amount.toString(), - })}, as it will result in a health factor lower than 1.` + })}, as it will likely result in a health factor lower than 1.` }