Skip to content

Conversation

AGMASO
Copy link
Collaborator

@AGMASO AGMASO commented Aug 20, 2025

General Changes

  • Added dynamic categories and asset filters on the Market page using the Coingecko API. We can now filter by: All, Stablecoins, or ETH-Correlated.

  • Improved mobile view with layout modifications.

  • Added dynamic categories and asset filters also in Dashboard page.

Developers Notes:

  • NOTE: You need to add the API key for --> COINGECKO_API_KEY=

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)

@AGMASO AGMASO requested a review from foodaka August 20, 2025 13:37
Copy link

vercel bot commented Aug 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
interface Ready Ready Preview Comment Sep 11, 2025 11:06am

@AGMASO AGMASO marked this pull request as ready for review August 21, 2025 16:55
Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

@mgrabina mgrabina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for automated categories but

hover seems off
Image
Also i think would be more pretty to have search on left and picker right.
and full width on mobile (and check left and right padding is same as top bottom seems smaller not sure)
Image

worth it adding in dashboard wherever we have more than X assets or assets in more than Y categories?

Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

@AGMASO AGMASO changed the title feat: added filters for categories in market section version 1.0.0 feat: added dynamic assets categories using Coingecko API Aug 25, 2025
Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

@mgrabina mgrabina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMAZING progress since the past iteration! would like to have others reviews as well as we have some design decisions to do before merging!

return await response.json();
},
queryKey: ['coingecko-categories'],
staleTime: 1000 * 60 * 60 * 24,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can even cache the response for a week?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 86 to 99
const [resEth1, resEth2, resEth3] = await Promise.all([
fetch(`${CG_ENDPOINT}?vs_currency=usd&category=liquid-staked-eth&per_page=250&page=1`, {
method: 'GET',
headers: HEADERS,
}),
fetch(`${CG_ENDPOINT}?vs_currency=usd&category=ether-fi-ecosystem&per_page=250&page=1`, {
method: 'GET',
headers: HEADERS,
}),
fetch(`${CG_ENDPOINT}?vs_currency=usd&category=liquid-staking-tokens&per_page=250&page=1`, {
method: 'GET',
headers: HEADERS,
}),
]);
Copy link
Contributor

@mgrabina mgrabina Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can make eth calls in parallel to stable to optimize

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +17 to +39
const isOriginAllowed = (origin: string | undefined): boolean => {
if (!origin) return false;

if (allowedOrigins.includes(origin)) return true;

// Match any subdomain ending with avaraxyz.vercel.app for deployment urls
const allowedPatterns = [/^https:\/\/.*avaraxyz\.vercel\.app$/];

return allowedPatterns.some((pattern) => pattern.test(origin));
};

if (process.env.CORS_DOMAINS_ALLOWED === 'true') {
res.setHeader('Access-Control-Allow-Origin', '*');
} else if (origin && isOriginAllowed(origin)) {
res.setHeader('Access-Control-Allow-Origin', origin);
}

res.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');

if (req.method === 'OPTIONS') {
return res.status(200).end();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice!

Comment on lines 75 to 82
.filter((res) =>
isAssetInCategoryDynamic(
res.symbol,
selectedCategory,
stablecoinSymbols,
ethCorrelatedSymbols
)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! so clean

ETH_CORRELATED = 'eth_correlated',
}

export const STABLECOINS_SYMBOLS_FALLBACK = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting. so i imagine the effect if the request takes time and I've selected a category will see the list to update .e.g. adding more items because coingecko has more than the fallback, wondering if it makes sense to have a fallback or just disable the picker until we have data. Plus, we can cache the data in the localStorage for a long time, since categories wont change frequently.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. I was thinking it would be a good idea to always render something for the user, for example, if the CoinGecko API is down. That said, I agree the other approach makes sense as well. Let’s make a final decision with the rest of the team, and I can update it, no problem.

Copy link

github-actions bot commented Sep 1, 2025

Copy link

github-actions bot commented Sep 1, 2025

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

github-actions bot commented Sep 9, 2025

Copy link

github-actions bot commented Sep 9, 2025

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

mgrabina
mgrabina previously approved these changes Sep 9, 2025
Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

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

This PR introduced no changes to the JavaScript bundle! 🙌

@foodaka foodaka merged commit 2c25437 into main Sep 12, 2025
19 of 21 checks passed
@foodaka foodaka deleted the feat/add-filters branch September 12, 2025 11:50
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.

3 participants