fix borrow modal

This commit is contained in:
Tyler Shipe 2021-06-07 17:56:56 -04:00
parent 330ef82a32
commit 485718cd1b
2 changed files with 7 additions and 5 deletions

View File

@ -297,6 +297,7 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
interest: selectedMangoGroup.getBorrowRate(assetIndex) * 100,
price: prices[assetIndex],
totalDeposits,
totalBorrows,
utilization: totalDeposits > 0.0 ? totalBorrows / totalDeposits : 0.0,
})
}, [borrowTokenSymbol])
@ -465,7 +466,7 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
</div>
</div>
<div className="flex justify-between pb-2">
<div className="text-th-fgd-4">Interest APY</div>
<div className="text-th-fgd-4">Interest APR</div>
<div className="text-th-fgd-1">
{borrowAssetDetails.interest.toFixed(2)}%
</div>
@ -479,9 +480,10 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
<div className="flex justify-between">
<div className="text-th-fgd-4">Available Liquidity</div>
<div className="text-th-fgd-1">
{borrowAssetDetails.totalDeposits.toFixed(
DECIMALS[borrowTokenSymbol]
)}{' '}
{(
borrowAssetDetails.totalDeposits -
borrowAssetDetails.totalBorrows
).toFixed(DECIMALS[borrowTokenSymbol])}{' '}
{borrowTokenSymbol}
</div>
</div>

View File

@ -80,8 +80,8 @@ export default function AccountBorrows() {
}, [])
const handleCloseDeposit = useCallback(() => {
setDepositToSettle(null)
setShowDepositModal(false)
setDepositToSettle(null)
}, [])
const handleShowBorrow = (symbol) => {