fix: market liquidity default to 0 (#34)

This commit is contained in:
Gustavo Mauricio 2022-10-25 11:31:13 +01:00 committed by GitHub
parent d22de166da
commit d3a1e9f3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

@ -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()