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 51 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 May 26, 2025 10:47am

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
@MartinGbz
Copy link
Contributor Author

@grothem @foodaka I've updated the PR yesterday

@MartinGbz
Copy link
Contributor Author

@grothem @foodaka PR has been again updated

@@ -150,5 +150,6 @@
"budget": null,
"budgetPercentIncreaseRed": 20,
"showDetails": true
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can omit this. Try running corepack disable

<Trans>Participating in this {symbol} reserve gives annualized rewards.</Trans>
<Trans>
Participating in this {symbol} reserve gives additional annualized rewards through Aave
Liquidity Mining
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think lets remove the "Liquidity Mining"


import { Link } from '../primitives/Link';

export const EthenaAirdropTooltipContent = ({ points }: { points: number }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file can probably be optimized into one component if it continues to grow. As its all the same except for the text and the link i think right?

};

const multipleIncentives = allAprsIncentivesCount >= 2;
const singleIncentives = allIncentivesCount >= 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this = 1 ?

textAlign: 'center',
}}
>
{value.toString() !== '-1' ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this -1 representing? Can we label it as a variable for readability

import { Link } from '../primitives/Link';
import { TextWithTooltip } from '../TextWithTooltip';

export const SuperFestTooltip = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here these can be extracted into a component i think all the logic and text is the same.

Copy link

github-actions bot commented May 30, 2025

❌ CI run has failed!
Please see logs at https://github.com/aave/interface/actions/runs/15350482355'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants