Skip to content

✨ Refactor and Improve all incentives #2308

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

Open
wants to merge 48 commits into
base: main
Choose a base branch
from

Conversation

MartinGbz
Copy link
Contributor

@MartinGbz MartinGbz commented Jan 7, 2025

General Changes

  • This PR adds all the incentives (lm, merit, zksync ignite) on all remaining, ie:

    • Supply Info
    • Borrow Info
    • Supply Modal
    • Borrow Modal
    • Collateral Swap Modal
    • Debt Swap Modal
  • It also add 2 new compoenent for:

    • "Points incentives" => allows to define every points program here (ethena, sonic, etherfi...)
    • "Simple external incentives" => allow to define every external simple incentives (spark, kernel, superfest)
      This allows to centralized every points/external incentives display at the same place.
      I also now specify the chain in the key of Set/Map for these component, because it can happen sometimes that different tokens can have the same address (Example: aAvaSAvax === aArbWstETH). So this prevent from this issue.
  • It also adds a new component that batch incentives APRs when multiple (2 or more) are available for an asset. This new component display the sum of all the incentives APRs. I decided to only batch APRs incentives and not points & "external simple incentives" in order to highlight them way better (so you have: the aprs, the points, and the others). This means the maximum number of tooltips we can expected below the Supply/Borrow rate will be 3 (which I think is acceptable).

  • It also fix 3 issues:

    • switch collateral/debt modal: If you switched from an incentivized asset to another one, no issue. But if you switched from a non-incentivized asset to a incentivized one, you will have no Reward APR display.
    • switch debt modal: 2 same source asset lm aprs were displayed (not the source and target asset were displayed)
    • ZKSync Ignite borrow APRs (even if for now no borrow aprs is available) wasn't showing up in the "Your borrows" section (but displayed in the "Assets to borrow" section. This is because a variableDebtTokenAddress get from the reserve were undefined. Use the reserve.variableDebtTokenAddress fix this issue (more info in this commit: 25a1cf0)
  • It also fix the forum post link of Sonic USDC.e Merit incentives

You can test all the cases on all Modals/Infos by mocking API returns.
Here's a few screenshots of the preview (I added a Merit incentive on USDS supply + borrow, and a ZKSync Ignite incentives on USDS supply):

Markets (showcase the new apr batched tooltip unfolded):

Capture d’écran 2025-03-06 à 12 27 27 Capture d’écran 2025-03-06 à 12 26 13

Supply Info:

Capture d’écran 2025-02-18 à 15 36 21

Switch Supply Modal:

Capture d’écran 2025-02-18 à 15 09 47

Switch Debt Modal:

Capture d’écran 2025-02-18 à 15 35 54

Supply Modal:

Capture d’écran 2025-02-18 à 15 35 00

Borrow Modal:

Capture d’écran 2025-02-18 à 15 35 10

Developer Notes

Created a new IncentivesBox component that can be used everywhere in the app.
So we only need to define any new incentive type in this component, and it will be display everywhere else.

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

height bot commented Jan 7, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
interface-ez7q ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 5:38pm

Copy link

vercel bot commented Jan 7, 2025

@MartinGbz is attempting to deploy a commit to the Avara Team on Vercel.

A member of the Team first needs to authorize it.

@MartinGbz MartinGbz changed the title ✨ Implement incentives to all remaining components ✨ Refactor and Improve all incentives Mar 6, 2025
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.

1 participant