Skip to content

Comments

fix: handle API inconsistency and update URL#2875

Merged
foodaka merged 2 commits intomainfrom
feat/blacklist-ink-campaign
Feb 16, 2026
Merged

fix: handle API inconsistency and update URL#2875
foodaka merged 2 commits intomainfrom
feat/blacklist-ink-campaign

Conversation

@AGMASO
Copy link
Collaborator

@AGMASO AGMASO commented Feb 16, 2026

General Changes

  • Updated the API URL to resolve pagination errors and restrict results to live campaigns only.
  • Fixed an API inconsistency where explorer addresses did not match the tokens returned in the array.

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)

Copilot AI review requested due to automatic review settings February 16, 2026 10:19
@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Feb 16, 2026 11:31am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Merkl points incentives hook to better align with Merkl API behavior by tightening the opportunities query and making opportunity matching resilient to inconsistent explorerAddress data.

Changes:

  • Updated the tyDro Merkl API URL to request more items and only LIVE opportunities.
  • Adjusted opportunity matching to prefer explorerAddress but fall back to the tokens list to handle API inconsistencies.
  • Filtered/select the points campaign breakdown based on a hardcoded INK point token address.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 100 to 104
const pointsOpportunities = opportunities.filter((opp) =>
opp.rewardsRecord.breakdowns.some((breakdown) =>
INK_POINT_TOKEN_ADDRESSES.includes(breakdown.token.address)
)
);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

INK_POINT_TOKEN_ADDRESSES.includes(breakdown.token.address) is case-sensitive. Merkl API addresses may come back lowercased while the hardcoded address is checksummed, causing point opportunities to be filtered out unexpectedly. Normalize both sides (e.g., compare .toLowerCase() or precompute a lowercased Set).

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines 112 to 114
const rewardsBreakdown = opportunity.rewardsRecord.breakdowns.find((breakdown) =>
INK_POINT_TOKEN_ADDRESSES.includes(breakdown.token.address)
);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Same case-sensitivity issue here: INK_POINT_TOKEN_ADDRESSES.includes(breakdown.token.address) may fail if the API returns a different address casing. Consider normalizing addresses (lowercasing or checksumming) before doing the lookup so the correct rewards breakdown is found reliably.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Feb 16, 2026

@AGMASO I've opened a new pull request, #2876, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 16, 2026

@AGMASO I've opened a new pull request, #2877, to work on those changes. Once the pull request is ready, I'll request review from you.

…Merkl incentives (#2877)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AGMASO <95312462+AGMASO@users.noreply.github.com>
@github-actions
Copy link

@github-actions
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 f5db583 into main Feb 16, 2026
14 of 21 checks passed
@foodaka foodaka deleted the feat/blacklist-ink-campaign branch February 16, 2026 12:05
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