diff --git a/hooks/useCalculateMaxBorrowAmount.tsx b/hooks/useCalculateMaxBorrowAmount.tsx index 3e89abf3..ec3e226b 100644 --- a/hooks/useCalculateMaxBorrowAmount.tsx +++ b/hooks/useCalculateMaxBorrowAmount.tsx @@ -65,7 +65,7 @@ const useCalculateMaxBorrowAmount = (denom: string, isUnderCollateralized: boole .toNumber() } - const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? '') + const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? 0) .div(10 ** getTokenDecimals(denom)) .toNumber() diff --git a/pages/borrow.tsx b/pages/borrow.tsx index 0b157a38..25421be8 100644 --- a/pages/borrow.tsx +++ b/pages/borrow.tsx @@ -56,7 +56,7 @@ const Borrow = () => { .map((denom) => { const { symbol, chain, icon } = getTokenInfo(denom) const borrowRate = Number(marketsData?.[denom].borrow_rate) || 0 - const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? '') + const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? 0) .div(10 ** getTokenDecimals(denom)) .toNumber() @@ -86,7 +86,7 @@ const Borrow = () => { .map((denom) => { const { symbol, chain, icon } = getTokenInfo(denom) const borrowRate = Number(marketsData?.[denom].borrow_rate) || 0 - const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? '') + const marketLiquidity = BigNumber(redbankBalances?.[denom] ?? 0) .div(10 ** getTokenDecimals(denom)) .toNumber()