diff --git a/packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx b/packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx index 44bfaf23e6..7c6a86f3f8 100644 --- a/packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx +++ b/packages/synapse-interface/pages/pool/poolManagement/Deposit.tsx @@ -37,6 +37,7 @@ import DepositButton from './DepositButton' import { txErrorHandler } from '@/utils/txErrorHandler' import { fetchPoolUserData } from '@/slices/poolUserDataSlice' import { swapPoolCalculateAddLiquidity } from '@/actions/swapPoolCalculateAddLiquidity' +import { zeroAddress } from 'viem' export const DEFAULT_DEPOSIT_QUOTE = { priceImpact: 0n, @@ -208,6 +209,7 @@ const Deposit = ({ { const [serializedToken, setSerializedToken] = useState(undefined) - const balanceToken = correctToken(tokenObj.token) + const balanceToken = getBalanceToken(tokenObj.token, pool) useEffect(() => { const fetchSerializedData = async () => { @@ -281,12 +284,11 @@ const SerializedDepositInput = ({ ) } -const correctToken = (token: Token) => { +const getBalanceToken = (token: Token, pool: Token) => { let balanceToken: Token | undefined - if (token.symbol == WETH.symbol) { + if (token.symbol == WETH.symbol && !pool.nativeTokens.includes(WETH)) { balanceToken = ETH } else if (token.symbol == AVWETH.symbol) { - // token = WETHE balanceToken = WETHE } else { balanceToken = token @@ -302,7 +304,7 @@ const serializeToken = async ( ) => { let fetchedBalance - if (balanceToken === ETH) { + if (balanceToken.addresses[chainId] === zeroAddress) { fetchedBalance = await fetchBalance({ address: address as Address, chainId,