Skip to content

fix(markets): exclude hidden reserves from collateral swap targets - #3132

Open
shivam-V8 wants to merge 1 commit into
aave:mainfrom
shivam-V8:fix/3131-collateral-swap-hidden-assets
Open

shivam-V8 wants to merge 1 commit into
aave:mainfrom
shivam-V8:fix/3131-collateral-swap-hidden-assets

Conversation

@shivam-V8

Copy link
Copy Markdown

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

General Changes

Developer Notes

getTokensTo (CollateralSwapModalContent.tsx) filtered only on frozen/paused and the GHO rule. The supply list (SupplyAssetsList.tsx:85-91), both dashboard position lists, the markets list and the sibling debt-swap modal (DebtSwapModalContent.tsx:173) all apply isAssetHidden as well — the collateral-swap target list was the only one that did not, so a reserve hidden everywhere else was still selectable as a swap destination.

The currentMarket parameter was typed string while isAssetHidden takes a CustomMarket. The caller already passes store.currentMarket, which is a CustomMarket, so the parameter type is narrowed rather than cast — the same shape DebtSwapModalContent already uses.

Tests — none added. This is one predicate reusing an existing helper, and the repo has no component tests for these modals. Verified with tsc --noEmit (meaningful here because of the type narrowing), next lint, and the jest suite, which is unchanged.

Pre-existing failures — the 4 jest suites in src/utils/ that fail on main (a wagmi/chains import issue) are unaffected.

One caveat: I verified this by code reading and typecheck, not in the browser — reproducing it needs a reserve configured in NEXT_PUBLIC_HIDDEN_RESERVES locally. Worth doing before you push if you want the PR to claim a visual check.

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 aave#3131
@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown

@Krshivam25 is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: hidden reserves are still offered as collateral swap targets

2 participants