Skip to content
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: kelp points #2335

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
(github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
!contains(github.head_ref, 'dependabot'))
strategy:
matrix:
build:
- name: 'out'
cypress_enabled: 'false'
- name: 'out_cypress'
cypress_enabled: 'true'
matrix:
build:
- name: 'out'
cypress_enabled: 'false'
- name: 'out_cypress'
cypress_enabled: 'true'
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
with:
fail-on-severity: critical
fail-on-severity: critical
1 change: 1 addition & 0 deletions public/icons/other/kernel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions src/components/infoTooltips/KernelAirdropTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Trans } from '@lingui/macro';

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

export const KernelAirdropTooltip = () => {
return (
<TextWithTooltip
wrapperProps={{ ml: 2 }}
color="warning.main"
iconSize={20}
icon={<image href="/icons/other/kernel.svg" width={25} height={25} />}
>
<>
<Trans>
{`This asset is eligible for Kernel points incentive program. Aave Labs does not
guarantee the program and accepts no liability.\n`}
</Trans>
<br />
<br />
<Trans>{'Learn more about the Kernel points distribution'}</Trans>{' '}
<Link
href="https://kerneldao.gitbook.io/kernel/getting-started/editor/kernel-points-guide "
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
>
{'here'}
</Link>
{'.'}
</>
</TextWithTooltip>
);
};
2 changes: 1 addition & 1 deletion src/locales/el/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,10 @@ msgstr "View Bridge Transactions"
msgid "Invalid return value of the flashloan executor function"
msgstr "Invalid return value of the flashloan executor function"

#: src/components/infoTooltips/KernelAirdropTooltip.tsx
msgid "Learn more about the Kernel points distribution"
msgstr "Learn more about the Kernel points distribution"

#: src/components/isolationMode/IsolatedBadge.tsx
msgid "Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral."
msgstr "Asset can be only used as collateral in isolation mode with limited borrowing power. To enter isolation mode, disable all other collateral."
Expand Down Expand Up @@ -3141,6 +3145,10 @@ msgstr "Maximum amount available to borrow is limited because protocol borrow ca
msgid "COPY IMAGE"
msgstr "COPY IMAGE"

#: src/components/infoTooltips/KernelAirdropTooltip.tsx
msgid "This asset is eligible for Kernel points incentive program. Aave Labs does not guarantee the program and accepts no liability."
msgstr "This asset is eligible for Kernel points incentive program. Aave Labs does not guarantee the program and accepts no liability."

#: src/components/transactions/DebtSwitch/DebtSwitchModalContent.tsx
msgid "Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch."
msgstr "Insufficient collateral to cover new borrow position. Wallet must have borrowing power remaining to perform debt switch."
Expand Down
2 changes: 1 addition & 1 deletion src/locales/es/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/fr/messages.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/modules/dashboard/lists/ListItemWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Tooltip, Typography } from '@mui/material';
import { ReactNode } from 'react';
import { BorrowDisabledToolTip } from 'src/components/infoTooltips/BorrowDisabledToolTip';
import { KernelAirdropTooltip } from 'src/components/infoTooltips/KernelAirdropTooltip';
import { OffboardingTooltip } from 'src/components/infoTooltips/OffboardingToolTip';
import { PausedTooltip } from 'src/components/infoTooltips/PausedTooltip';
import { SpkAirdropTooltip } from 'src/components/infoTooltips/SpkAirdropTooltip';
Expand Down Expand Up @@ -54,6 +55,7 @@ export const ListItemWrapper = ({
showExternalIncentivesTooltips = {
superFestRewards: false,
spkAirdrop: false,
kernelPoints: false,
},
...rest
}: ListItemWrapperProps) => {
Expand Down Expand Up @@ -93,6 +95,7 @@ export const ListItemWrapper = ({
{paused && <PausedTooltip />}
{showExternalIncentivesTooltips.superFestRewards && <SuperFestTooltip />}
{showExternalIncentivesTooltips.spkAirdrop && <SpkAirdropTooltip />}
{showExternalIncentivesTooltips.kernelPoints && <KernelAirdropTooltip />}
{showFrozenTooltip && <FrozenTooltip symbol={symbol} currentMarket={currentMarket} />}
{showRenFilTooltip && <RenFILToolTip />}
{showAmplTooltip && <AMPLToolTip />}
Expand Down
3 changes: 3 additions & 0 deletions src/modules/dashboard/lists/ListMobileItemWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ReactNode } from 'react';
import { BorrowDisabledToolTip } from 'src/components/infoTooltips/BorrowDisabledToolTip';
import { KernelAirdropTooltip } from 'src/components/infoTooltips/KernelAirdropTooltip';
import { OffboardingTooltip } from 'src/components/infoTooltips/OffboardingToolTip';
import { PausedTooltip } from 'src/components/infoTooltips/PausedTooltip';
import { SpkAirdropTooltip } from 'src/components/infoTooltips/SpkAirdropTooltip';
Expand Down Expand Up @@ -51,6 +52,7 @@ export const ListMobileItemWrapper = ({
showExternalIncentivesTooltips = {
superFestRewards: false,
spkAirdrop: false,
kernelPoints: true,
},
}: ListMobileItemWrapperProps) => {
const WarningComponent: React.FC = () => {
Expand All @@ -66,6 +68,7 @@ export const ListMobileItemWrapper = ({
{paused && <PausedTooltip />}
{showExternalIncentivesTooltips.superFestRewards && <SuperFestTooltip />}
{showExternalIncentivesTooltips.spkAirdrop && <SpkAirdropTooltip />}
{showExternalIncentivesTooltips.kernelPoints && <KernelAirdropTooltip />}
{showFrozenTooltip && <FrozenTooltip symbol={symbol} currentMarket={currentMarket} />}
{showRenFilTooltip && <RenFILToolTip />}
{showAmplTooltip && <AMPLToolTip />}
Expand Down
15 changes: 15 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const roundToTokenDecimals = (inputValue: string, tokenDecimals: number)
export type ExternalIncentivesTooltipsConfig = {
superFestRewards: boolean;
spkAirdrop: boolean;
kernelPoints: boolean;
};

export const showExternalIncentivesTooltip = (
Expand All @@ -87,10 +88,12 @@ export const showExternalIncentivesTooltip = (
) => {
const superFestRewardsEnabled = false;
const spkRewardsEnabled = true;
const kernelPointsEnabled = true;

const tooltipsConfig: ExternalIncentivesTooltipsConfig = {
superFestRewards: false,
spkAirdrop: false,
kernelPoints: false,
};

if (
Expand All @@ -111,5 +114,17 @@ export const showExternalIncentivesTooltip = (
tooltipsConfig.spkAirdrop = true;
}

if (
kernelPointsEnabled &&
(currentMarket === CustomMarket.proto_mainnet_v3 ||
currentMarket === CustomMarket.proto_lido_v3 ||
currentMarket === CustomMarket.proto_base_v3 ||
currentMarket === CustomMarket.proto_arbitrum_v3) &&
protocolAction === ProtocolAction.supply &&
symbol == 'rsETH'
) {
tooltipsConfig.kernelPoints = true;
}

return tooltipsConfig;
};