Skip to content

feat: route native supplies through the Aave modal, fun.xyz as secondary option - #3152

Open
sammdec wants to merge 3 commits into
mainfrom
feat/fun-other-deposit-options
Open

sammdec wants to merge 3 commits into
mainfrom
feat/fun-other-deposit-options

Conversation

@sammdec

@sammdec sammdec commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

General Changes

Native deposits for fun.xyz-supported assets (USDC, USDT, WBTC, cbBTC on Core mainnet) now go through the Aave contracts only. fun.xyz remains available as a secondary option for swaps, cross-chain, card and exchange deposits.

  • Native modal first: Supply buttons (dashboard desktop/mobile, reserve overview) open the native Aave supply modal whenever the user holds the asset. Replaces useSupplyButtonAction; FunSupplyButton is rebuilt around a wallet-balance check (see below).
  • Other deposit options link: new FunDepositOptionsLink under the amount input: "or use a card, exchanges or swaps to deposit ›". Only rendered for allowlisted assets; disabled while a supply tx is in flight.
  • Hand-off: clicking the link closes the native modal and opens the funkit checkout (useOpenFunSupply). If the funkit island hasn't mounted yet, the native modal stays open.
  • No native deposits in funkit:
    • disabledSourceTokens blocks the supplied token on the same chain as a source (swaps, cross-chain, card, exchange stay available).
    • The SDK also shows an Aave-only "Native" source row plus a direct native-supply path, keyed on our API key with no client config to turn it off. fun.xyz is disabling this on their side, so there is no SDK patch in this PR.
  • Empty wallet: Supply stays enabled for allowlisted assets when the wallet balance is zero, and opens the funkit checkout directly, skipping the native modal (falls back to the native modal if funkit isn't ready). "Zero" is exact; dust balances still get the native modal. Applies to the dashboard and the reserve overview page.

Developer Notes

  • Dependency on fun.xyz: until fun.xyz turns off the native fast path for our API key, the funkit modal still shows the "Native" row when the wallet holds the target token. Confirm that change is live before (or alongside) shipping this.
  • disabledSourceTokens typing: the SDK's TokenInfo type declares pickedChainId, but its runtime check (useAllowedAssets) matches tokenChainId. We set both, with a cast.
  • Jest: the same 4 suites in src/utils/__tests__ fail on main as on this branch (not related).

Tested locally

  • Watch-only mode, Core market: USDC (has balance) opens the native modal with the link; clicking it closes the modal and hands off to funkit. WETH shows no link. WBTC (zero balance) skips the native modal and goes straight to funkit, from both the dashboard and the reserve page.
  • Manually tested in the browser by the author.
  • Worth a reviewer pass with a connected wallet on exchange deposits of the same token to mainnet — the least certain funkit path.

Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • End-to-end tests are passing without any errors
  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introduce potential security threats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)

🤖 Generated with Claude Code

…ary option

Native deposits for fun.xyz-supported assets no longer go through the
funkit checkout. Supply buttons always open the native Aave supply modal;
for allowlisted Core mainnet assets the modal shows an "or use a card,
exchanges or swaps to deposit" link that opens the funkit checkout.

Inside funkit, same-chain same-token deposits are blocked via
disabledSourceTokens, and the SDK's Aave-only "Native" source row and
direct native-supply path are disabled via the existing pnpm patch
(no config option exists for this, up to @funkit/connect 12.20.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
interface Ready Ready Preview Oct 26, 2026 2:35pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.34 MB (🟡 +304 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Ten Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 93.09 KB (🟢 -425 B) 1.43 MB
/dashboard 81.6 KB (🟢 -584 B) 1.42 MB
/governance 43.24 KB (🟡 +59 B) 1.38 MB
/governance/ipfs-preview 97.64 KB (🟢 -87 B) 1.44 MB
/governance/v3/proposal 84.56 KB (🟡 +71 B) 1.42 MB
/markets 54.86 KB (🟡 +198 B) 1.39 MB
/reserve-overview 38.2 KB (🟢 -753 B) 1.38 MB
/safety-module 55.72 KB (🟡 +40 B) 1.39 MB
/sgho 92.82 KB (🟡 +40 B) 1.43 MB
/v3-migration 49.12 KB (🟡 +40 B) 1.39 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

…let balance

PRD F-5/F-6: for fun.xyz-supported assets the Supply button stays enabled
with an empty wallet, and with a zero balance it opens the funkit checkout
straight away (native deposits are excluded there). With any balance it
opens the native Aave supply modal, which links to the same checkout.
Applied to the dashboard (desktop/mobile) and the reserve overview page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sammdec sammdec changed the title feat: route native supplies through the Aave modal, fun.xyz as secondary option feat: route native supplies through the Aave modal, fun.xyz as secondary option (F-1–F-6) Oct 26, 2026
fun.xyz is disabling the native supply option for our API key on their
side, so the local SDK patch is no longer needed. The patch file is back
to main (ENS normalize fix only). disabledSourceTokens stays in the
checkout config as a client-side guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.34 MB (🟡 +302 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Ten Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 93.85 KB (🟡 +359 B) 1.43 MB
/dashboard 82.37 KB (🟡 +201 B) 1.42 MB
/governance 43.24 KB (🟡 +59 B) 1.38 MB
/governance/ipfs-preview 97.64 KB (🟢 -87 B) 1.44 MB
/governance/v3/proposal 84.56 KB (🟡 +71 B) 1.42 MB
/markets 54.86 KB (🟡 +198 B) 1.39 MB
/reserve-overview 39.13 KB (🟡 +199 B) 1.38 MB
/safety-module 55.72 KB (🟡 +40 B) 1.39 MB
/sgho 92.82 KB (🟡 +40 B) 1.43 MB
/v3-migration 49.12 KB (🟡 +40 B) 1.39 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@sammdec
sammdec requested a review from grothem October 26, 2026 15:39
@sammdec sammdec changed the title feat: route native supplies through the Aave modal, fun.xyz as secondary option (F-1–F-6) feat: route native supplies through the Aave modal, fun.xyz as secondary option Oct 26, 2026

This branch was successfully deployed

1 active deployment
Preview — 7aecff9c Deployed Oct 26, 2026 by vercel[bot]
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.

1 participant