Skip to content

Fix/avail liq emode#3049

Open
sammdec wants to merge 2 commits into
mainfrom
fix/avail-liq-emode
Open

Fix/avail liq emode#3049
sammdec wants to merge 2 commits into
mainfrom
fix/avail-liq-emode

Conversation

@sammdec

@sammdec sammdec commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

General Changes

  • Fixes available liquidity showing $0 on the reserve overview for assets that are only borrowable in E-mode
  • Builds on fix: show 0 for available liquidity if borrowing not enabled #3011, which correctly hides liquidity when borrowingEnabled is false — this extends that logic to also account for E-mode borrowability
  • Adds assetIsBorrowableOnMarket() in getMaxAmountAvailableToBorrow.ts to check whether a reserve is borrowable in normal mode or any E-mode category (mirrors on-chain ValidationLogic behavior)
  • Updates ReserveTopDetails.tsx to use the new helper for the "Available liquidity" display
  • Adds unit tests in getMaxAmountAvailableToBorrow.spec.ts

Why this change?

Some reserves have borrowingEnabled: false in normal mode but remain borrowable when a user is in E-mode (via the category borrowableBitmap, exposed in the UI as eMode.borrowingEnabled). The reserve overview is market-level, so we show liquidity if the asset is borrowable through any path - not just normal mode.

How to verify

  • Open a reserve where borrowingEnabled is false but the asset is borrowable in an E-mode → "Available liquidity" should show the actual USD value
  • Open a reserve that is not borrowable in normal mode or any E-mode → "Available liquidity" should show $0
  • Run yarn test getMaxAmountAvailableToBorrow

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)

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Jun 28, 2026 9:41am

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 Decreased

Page Size (compressed)
global 1.29 MB (-1 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!

Three Pages Changed Size

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

Page Size (compressed) First Load
/ 68.15 KB (🟡 +26 B) 1.36 MB
/dashboard 57.79 KB (🟡 +26 B) 1.35 MB
/reserve-overview 26.82 KB (🟡 +22 B) 1.32 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.

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.

2 participants