From a917daa25fe8b2c461bccfcc36cdfbc77ef4d51f Mon Sep 17 00:00:00 2001 From: "krshivam2505@gmail.com" Date: Mon, 12 Oct 2026 07:14:03 +0530 Subject: [PATCH] fix(markets): exclude hidden reserves from collateral swap targets Reserves hidden by HIDDEN_ASSETS or NEXT_PUBLIC_HIDDEN_RESERVES were still offered as collateral swap destinations. Every sibling list already applies isAssetHidden, including the debt swap modal, so apply it here too. The currentMarket parameter is narrowed to CustomMarket to match the value the caller already passes. Closes #3131 --- .../Swap/modals/request/CollateralSwapModalContent.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/transactions/Swap/modals/request/CollateralSwapModalContent.tsx b/src/components/transactions/Swap/modals/request/CollateralSwapModalContent.tsx index 8bcfb61bee..a598ce3f24 100644 --- a/src/components/transactions/Swap/modals/request/CollateralSwapModalContent.tsx +++ b/src/components/transactions/Swap/modals/request/CollateralSwapModalContent.tsx @@ -8,7 +8,9 @@ import { } from 'src/hooks/app-data-provider/useAppDataProvider'; import { TokenInfoWithBalance } from 'src/hooks/generic/useTokensBalance'; import { ExtendedFormattedUser } from 'src/hooks/pool/useExtendedUserSummaryAndIncentives'; +import { isAssetHidden } from 'src/modules/dashboard/lists/constants'; import { useRootStore } from 'src/store/root'; +import { CustomMarket } from 'src/ui-config/marketsConfig'; import { TOKEN_LIST, TokenInfo } from 'src/ui-config/TokenList'; import { displayGhoForMintableMarket } from 'src/utils/ghoUtilities'; import { useShallow } from 'zustand/shallow'; @@ -210,14 +212,15 @@ const getTokensTo = ( user: ExtendedFormattedUser | undefined, reserves: ComputedReserveData[], baseTokensInfo: TokenInfo[], - currentMarket: string, + currentMarket: CustomMarket, chainId: number ): SwappableToken[] => { // Tokens To should be the potential supply tokens (so we have an aToken) const tokensToSupply = reserves.filter( (reserve: ComputedReserveData) => !(reserve.isFrozen || reserve.isPaused) && - !displayGhoForMintableMarket({ symbol: reserve.symbol, currentMarket: currentMarket }) + !displayGhoForMintableMarket({ symbol: reserve.symbol, currentMarket: currentMarket }) && + !isAssetHidden(currentMarket, reserve.underlyingAsset) ); const suppliedPositions =