-
Notifications
You must be signed in to change notification settings - Fork 467
feat: added hardcoded incentives for PYUSD #2706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds hardcoded incentive data for PYUSD (PayPal USD) stablecoin in the Aave protocol. The change enables display of specific incentive information for PYUSD suppliers without relying on external API data.
- Adds hardcoded incentive configuration for PYUSD A_TOKEN
- Implements conditional logic to return hardcoded data when PYUSD is the rewarded asset
- Includes custom messaging about PYUSD program requirements
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const protocolIncentivesAPR = protocolIncentives.reduce((sum, inc) => { | ||
| return sum + (inc.incentiveAPR === 'Infinity' ? 0 : +inc.incentiveAPR); | ||
| }, 0); | ||
| const merklIncentivesAPY = convertAprToApy(0.1); |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded value 0.1 (10%) should be extracted as a named constant to improve maintainability and make the source of this value clear.
| breakdown: { | ||
| protocolAPY: 0, | ||
| protocolIncentivesAPR: 0, | ||
| merklIncentivesAPR: 0, | ||
| totalAPY: 0, | ||
| isBorrow: false, | ||
| breakdown: { | ||
| protocol: 0, | ||
| protocolIncentives: 0, | ||
| merklIncentives: 0, | ||
| }, | ||
| }, |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breakdown object in the hardcoded incentives appears to be duplicated and potentially inconsistent with the dynamically calculated breakdown returned later. Consider removing the hardcoded breakdown since it's recalculated anyway.
| breakdown: { | |
| protocolAPY: 0, | |
| protocolIncentivesAPR: 0, | |
| merklIncentivesAPR: 0, | |
| totalAPY: 0, | |
| isBorrow: false, | |
| breakdown: { | |
| protocol: 0, | |
| protocolIncentives: 0, | |
| merklIncentives: 0, | |
| }, | |
| }, |
| } as MerklIncentivesBreakdown, | ||
| } as ExtendedReserveIncentiveResponse; |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using type assertions with 'as' can bypass TypeScript's type checking. Consider ensuring the object structure matches the expected types or use proper type guards to validate the structure.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
General Changes
Developer Notes
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.
.env.examplefile as well as the pertinant.github/actions/*files