-
Notifications
You must be signed in to change notification settings - Fork 428
feat: juice apys #2550
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
feat: juice apys #2550
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
📦 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! 🙌 |
|
📦 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! 🙌 |
|
📦 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! 🙌 |
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.
console.log('WHAT IS THE USER', user); | ||
// amount calculations | ||
const maxAmountToBorrow = getMaxAmountAvailableToBorrow(poolReserve, user); | ||
|
||
console.log('maxAmountToBorrow', maxAmountToBorrow); | ||
|
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.
logs
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.
removed in 13c82b4
<IncentivesIcon width="16" height="16" /> | ||
</Box> | ||
); | ||
} else if (incentivesNetAPR === 'Infinity') { |
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.
should we set Inifinite as a const, or use undefinded/uint_max const?
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.
yeah its better 1c15a3e
// p: { xs: '0 4px', xsm: '2px 4px' }, | ||
// border: `1px solid ${open ? theme.palette.action.disabled : theme.palette.divider}`, |
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.
can remove?
|
||
const protocolIncentivesAPR = | ||
incentives?.reduce((sum, inc) => { | ||
return sum + (inc.incentiveAPR === 'Infinity' ? 0 : +inc.incentiveAPR); |
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.
is this intended? if incentive is infinite sum 0? if so, nomeclature feels confusing not sure if there is a better way
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.
ive updated here to handle infinity, im not sure tbh how often it is actually infinity but we can display it 1c15a3e
console.log('USER BORROWS', user.availableBorrowsUSD); | ||
console.log( | ||
'availableForUserMarketReferenceCurrency', | ||
availableForUserMarketReferenceCurrency.toString() | ||
); | ||
console.log('availableLiquidity', availableLiquidity.toString()); |
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.
logs
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.
removed in 13c82b4
|
📦 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! 🙌 |
|
📦 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! 🙌 |
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 consolidates APY calculations by combining protocol, merit, and merkl incentives into a single total APY display. The main change replaces individual FormattedNumber
display with an IncentivesCard
component that calculates and shows the combined rates.
- Replaces individual APY display with unified incentives card component
- Adds breakdown calculation for total APY including all incentive types
- Updates tooltip content to show comprehensive APY breakdown with all incentive sources
Reviewed Changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/modules/reserve-overview/SupplyInfo.tsx | Replaces FormattedNumber + IncentivesButton with unified IncentivesCard component |
src/locales/en/messages.po | Adds new translation strings for APY breakdown display |
src/locales/en/messages.js | Updates compiled translation messages |
src/hooks/useMerklIncentives.ts | Adds breakdown calculation with total APY combining protocol and incentive rates |
src/hooks/useMeritIncentives.ts | Adds breakdown calculation with total APY combining protocol and incentive rates |
src/components/transactions/Borrow/BorrowModalContent.tsx | Adds console.log for debugging purposes |
src/components/incentives/MeritIncentivesTooltipContent.tsx | Enhances tooltip to show detailed APY breakdown with all components |
src/components/incentives/IncentivesTooltipContent.tsx | Updates tooltip to display comprehensive APY breakdown including all incentive types |
src/components/incentives/IncentivesCard.tsx | Implements unified APY calculation combining protocol + all incentive types |
src/components/incentives/IncentivesButton.tsx | Updates to support new breakdown calculations and tooltip display |
Comments suppressed due to low confidence (1)
src/locales/en/messages.po:2439
- The removal of the 'Net APR' translation entry suggests this text is no longer used. Verify that all references to this translation key have been properly updated to use the new 'Net Protocol Incentives' translation instead.
#: src/components/transactions/Borrow/BorrowModalContent.tsx
// amount calculations | ||
const maxAmountToBorrow = getMaxAmountAvailableToBorrow(poolReserve, user); | ||
|
||
console.log('maxAmountToBorrow', maxAmountToBorrow); |
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.
Remove the console.log statement as it appears to be leftover debugging code and shouldn't be included in production code.
console.log('maxAmountToBorrow', maxAmountToBorrow); |
Copilot uses AI. Check for mistakes.
|
📦 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! 🙌 |
const displayAPY = hasInfiniteIncentives | ||
? 'Infinity' | ||
: isBorrow | ||
? protocolAPY - (protocolIncentivesAPR as number) - meritIncentivesAPR - merklIncentivesAPR | ||
: protocolAPY + (protocolIncentivesAPR as number) + meritIncentivesAPR + merklIncentivesAPR; |
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.
Be aware that you approximate APR as APY here
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.
Add of incentive on the reserve page is a good thing |
|
📦 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
Add any notes here that may be helpful for reviewers.
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.example
file as well as the pertinant.github/actions/*
files