From d3953318c93b9906fe36423c4f21b71ddef9b5b0 Mon Sep 17 00:00:00 2001 From: Majorfi Date: Thu, 4 Jan 2024 16:57:43 +0100 Subject: [PATCH] feat: handle boosted property from yDaemon --- CHANGELOG.md | 1 + apps/common/schemas/yDaemonVaultsSchemas.ts | 1 + apps/vaults-v3/components/details/VaultDetailsHeader.tsx | 6 ++++++ apps/vaults-v3/components/list/VaultsV3ListRow.tsx | 7 ++++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a1b36cfc..7a19f78d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.3.7 +- Feat: Adding boosted property handling. (04/01/2024) - Fix: Adjust max-loss default parameters. (04/01/2024) - Style: Hide divider when it's the last item in the setting popover. (04/01/2024) - Chores: add a message about v3 vaults being boosted. (04/01/2024) diff --git a/apps/common/schemas/yDaemonVaultsSchemas.ts b/apps/common/schemas/yDaemonVaultsSchemas.ts index 76159742b..1aea1c924 100644 --- a/apps/common/schemas/yDaemonVaultsSchemas.ts +++ b/apps/common/schemas/yDaemonVaultsSchemas.ts @@ -139,6 +139,7 @@ export const yDaemonVaultSchema = z.object({ }), featuringScore: z.number().default(0).catch(0), retired: z.boolean().default(false).catch(false), + boosted: z.boolean().default(false).catch(false), strategies: z.array(yDaemonVaultStrategySchema).nullable().default([]), staking: z .object({ diff --git a/apps/vaults-v3/components/details/VaultDetailsHeader.tsx b/apps/vaults-v3/components/details/VaultDetailsHeader.tsx index 72695519e..793e94414 100755 --- a/apps/vaults-v3/components/details/VaultDetailsHeader.tsx +++ b/apps/vaults-v3/components/details/VaultDetailsHeader.tsx @@ -193,6 +193,12 @@ export function VaultDetailsHeader({currentVault}: {currentVault: TYDaemonVault}
{chainInfo.name}
+ {currentVault.boosted ? ( +
+ {`⚡️ Boosted`} +
+ ) : null} diff --git a/apps/vaults-v3/components/list/VaultsV3ListRow.tsx b/apps/vaults-v3/components/list/VaultsV3ListRow.tsx index 9df06debc..20ec41fd2 100755 --- a/apps/vaults-v3/components/list/VaultsV3ListRow.tsx +++ b/apps/vaults-v3/components/list/VaultsV3ListRow.tsx @@ -20,6 +20,7 @@ import type {ReactElement} from 'react'; import type {TYDaemonVault} from '@common/schemas/yDaemonVaultsSchemas'; function VaultForwardAPR({currentVault}: {currentVault: TYDaemonVault}): ReactElement { + console.log(currentVault); const isEthMainnet = currentVault.chainID === 1; if (currentVault.apr.forwardAPR.type === '') { const hasZeroAPR = isZero(currentVault.apr?.netAPR) || Number((currentVault.apr?.netAPR || 0).toFixed(2)) === 0; @@ -239,6 +240,7 @@ function VaultForwardAPR({currentVault}: {currentVault: TYDaemonVault}): ReactEl + {currentVault.boosted ? '⚡️ ' : ''} ); } + const hasV3Composite = !isZero(currentVault?.apr?.forwardAPR.composite.v3OracleCurrentAPR) && - !isZero(currentVault?.apr?.forwardAPR.composite.v3OracleStratRatioAPR); + !isZero(currentVault?.apr?.forwardAPR.composite.v3OracleStratRatioAPR) && + false; if (hasV3Composite) { return (
@@ -288,6 +292,7 @@ function VaultForwardAPR({currentVault}: {currentVault: TYDaemonVault}): ReactEl + {currentVault.boosted ? '⚡️ ' : ''}