Skip to content

Conversation

foodaka
Copy link
Collaborator

@foodaka foodaka commented Aug 22, 2025

General Changes

  • Adds ability to claim merit rewards

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.

  • 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)

Copy link

vercel bot commented Aug 22, 2025

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

Project Deployment Preview Comments Updated (UTC)
interface Ready Ready Preview Comment Aug 25, 2025 0:55am

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! 🙌

@JoaquinBattilana JoaquinBattilana self-requested a review August 26, 2025 16:13
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.

reviewing code i think i don't have rewards to claim and test all flows

@@ -33,7 +33,7 @@
"dependencies": {
"@aave/contract-helpers": "1.36.1",
"@aave/math-utils": "1.36.1",
"@aave/react": "^0.4.0",
"@aave/react": "canary",
Copy link
Contributor

Choose a reason for hiding this comment

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

would rather a specific version to avoid issues on updates

// Calculate merit rewards USD value
const meritRewardsUsd =
meritClaimRewards?.rewards?.reduce((total, reward) => {
return total + Number(reward.amount.usd || 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

if we dont get a usd value shouldn't we return undefined/hide to avoid invalid values?

Comment on lines +52 to +54
const isClaimingAll = selectedReward.symbol === 'all';
const isClaimingMeritAll = selectedReward.symbol === 'merit-all';
const isClaimingProtocolAll = selectedReward.symbol === 'protocol-all';
Copy link
Contributor

Choose a reason for hiding this comment

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

we are using those keys in multiple places i'd say to use an enum

calls.push({
target: tx.to,
callData: tx.data,
value: tx.value || '0',
Copy link
Contributor

Choose a reason for hiding this comment

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

just double checking we are sending tx.value here and in return we set value to zero


return {
gasLimit: estimatedTx.gasLimit?.toString(),
gasPrice: '0',
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure where is this being used by pointing out gasPrice 0

claimType: 'all',
protocolRewardsCount,
meritRewardsCount,
totalRewardsCount: protocolRewardsCount + meritRewardsCount,
Copy link
Contributor

Choose a reason for hiding this comment

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

worth it to add usd value to compare with the next one?

Copy link
Contributor

Choose a reason for hiding this comment

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

ux idea: add a warning when the claimable amount in usd is lower than estimated gas required to execute the tx

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

idea 2: add "0.0004 Claimed" subtitle

Image

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