diff --git a/components/WithdrawModal.tsx b/components/WithdrawModal.tsx index 68d47d6..a64e7db 100644 --- a/components/WithdrawModal.tsx +++ b/components/WithdrawModal.tsx @@ -160,31 +160,12 @@ const WithdrawModal = ({ isOpen, onClose }) => { } } - const DECIMALS = { - BTC: 4, - ETH: 3, - USDT: 2, - } - const getBorrowAmount = () => { const tokenBalance = getMaxForSelectedAccount() const borrowAmount = parseFloat(inputAmount) - tokenBalance return borrowAmount > 0 ? borrowAmount : 0 } - const getInterestCostPerYear = () => { - const borrowAmount = getBorrowAmount() - const interestRate = selectedMangoGroup.getBorrowRate(tokenIndex) - const symbol = getSymbolForTokenMintAddress( - selectedAccount?.account?.mint.toString() - ) - if (borrowAmount > 0) { - const borrowCostPerYear = borrowAmount * interestRate - return `~${borrowCostPerYear.toFixed(DECIMALS[symbol])} ${symbol}` - } - return `0 ${symbol}` - } - if (!selectedAccount) return null return ( @@ -202,8 +183,8 @@ const WithdrawModal = ({ isOpen, onClose }) => { />