Skip to content

feat: dynamic borrow cap UI options (design review) - #3183

Draft
Agill-Sheron wants to merge 1 commit into
aave:mainfrom
Agill-Sheron:feat/dynamic-borrow-caps-ui
Draft

Agill-Sheron wants to merge 1 commit into
aave:mainfrom
Agill-Sheron:feat/dynamic-borrow-caps-ui

Conversation

@Agill-Sheron

@Agill-Sheron Agill-Sheron commented Nov 12, 2026 •

Copy link
Copy Markdown

Not for merging as is. This is a hand-off for Aave's engineering team to take over: the options run on simulated data and sit behind a review-only Tweaks popover. Pick a direction, lock it in, and wire the real contract reads before it ships.

Design-review options for reserves with a dynamic borrow cap (current cap kept just above total borrowed, raised automatically up to a max cap). Against the current cap alone, these reserves look nearly full all the time; these options show the max cap instead.

General Changes

  • Reserve page (?dyncap=): Today (default, unchanged) · Notice · Max cap · Vs max · Combined. Vs max and Combined add a usage bar on the max cap scale, with optional hover tooltips (?barhover=).
  • Markets page: notice, tag and a Dynamic cap column, each toggled on its own (?mktnotice=, ?mkttag=, ?mktcol=).
  • Borrow modal and reserve actions: notes for available now, cap used up, and max cap reached.
  • Dashboard borrow list: compact dynamic cap hint.

Developer Notes

  • Every option sits behind a floating Tweaks popover, active only in next dev or with NEXT_PUBLIC_ENABLE_TWEAKS=true. Production always shows Today.
  • Data is simulated until the contracts ship: simulatedCaps.ts marks Arbitrum v3 USDC as dynamic (?capstate= picks the state), and simulatedWallet.ts (?wallet=small|large) fakes a read-only position so the borrow flow can be reviewed without a wallet. The header of simulatedCaps.ts lists the contract reads that replace it.
  • DYNAMIC_CAPS_LEARN_MORE_URL is a placeholder.

Once an option is chosen

Lock it in and remove the review scaffolding. Example prompt for a coding agent:

Lock in the dynamic borrow cap options: reserve page Combined, bar hover on, markets page notice on, tag off, column off. Hardcode these as the only behaviour, delete the other options and their branches, and remove the Tweaks popover (DynamicCapsTweaks, src/components/tweaks/*, the useTweakParam calls and URL params, and its mount in _app.page.tsx). Keep the simulated data until the contracts are deployed, then replace it with the real reads described in simulatedCaps.ts.


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)

Options for showing a reserve whose borrow cap is dynamic: the cap the
pool enforces (the current cap) is kept about one buffer above total
borrowed, raised automatically up to a max cap. Read against the
current cap alone, such a reserve looks nearly full most of the time.

All options sit behind a floating Tweaks popover that is only active
when NODE_ENV=development or NEXT_PUBLIC_ENABLE_TWEAKS=true. The
choice rides the URL so a link opens the version it was copied from.
Production builds always show the default (Today, unchanged UI).

- Reserve page (?dyncap=): today | notice | max-cap | vs-max | combined
  - vs-max / combined: usage bar on the max cap scale (borrowed,
    available now, current cap tick); ?barhover=on|off adds hover
    tooltips per part
  - combined: notice + bar + a Max cap column next to Current cap
- Markets page, independent switches: ?mktnotice= (notice above the
  list), ?mkttag= (tag on total borrowed), ?mktcol= (Dynamic cap
  column with a check and the reserve's caps in a tooltip)
- Borrow modal and reserve actions: notes for available now, current
  cap used up (waiting for a raise) and max cap reached
- Dashboard borrow list: compact dynamic cap hint

Data is SIMULATED until the contracts are deployed:
- simulatedCaps.ts marks Arbitrum v3 USDC as dynamic and rewrites
  borrowCap to a current cap in usePoolFormattedReserves; ?capstate=
  picks topped-up | headroom | cap-reached | at-max. The header
  documents the contract reads that replace it.
- simulatedWallet.ts (?wallet=small|large) watches an unused address
  through read-only mode and substitutes a WETH-collateral position
  and balances, so the borrow flow can be reviewed without a wallet.
  Read-only mode cannot sign.

Remove the losing options, DynamicCapsTweaks, the simulated files and
their hooks once a direction is chosen. DYNAMIC_CAPS_LEARN_MORE_URL
is a placeholder.
@vercel

vercel Bot commented Nov 12, 2026

Copy link
Copy Markdown

@Agill-Sheron is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

@Agill-Sheron
Agill-Sheron marked this pull request as draft November 12, 2026 16:35

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.

1 participant