From 000036996b62e7f2cfbd556bbf730f2c33ae13cb Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:23:38 +0200 Subject: [PATCH 1/5] add seed value chart --- .../Analytics/Silo/SeedsPerSeason.graphql | 12 +++++++ .../components/Analytics/useChartSetupData.ts | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 projects/ui/src/components/Analytics/Silo/SeedsPerSeason.graphql diff --git a/projects/ui/src/components/Analytics/Silo/SeedsPerSeason.graphql b/projects/ui/src/components/Analytics/Silo/SeedsPerSeason.graphql new file mode 100644 index 0000000000..c1760c67c6 --- /dev/null +++ b/projects/ui/src/components/Analytics/Silo/SeedsPerSeason.graphql @@ -0,0 +1,12 @@ +query SeedsPerSeason($token: String!, $first: Int) { + seasons: whitelistTokenHourlySnapshots( + orderDirection: desc, + orderBy: season, + first: $first, + where: {token_contains_nocase: $token} + ) { + stalkEarnedPerSeason + season + createdAt + } +} \ No newline at end of file diff --git a/projects/ui/src/components/Analytics/useChartSetupData.ts b/projects/ui/src/components/Analytics/useChartSetupData.ts index 1d2bd9ba63..6dd42dc6d0 100644 --- a/projects/ui/src/components/Analytics/useChartSetupData.ts +++ b/projects/ui/src/components/Analytics/useChartSetupData.ts @@ -20,6 +20,7 @@ import { SeasonalVolumeDocument, SeasonalWeightedDeltaBDocument, SeasonalWeightedPriceDocument, + SeedsPerSeasonDocument, } from '~/generated/graphql'; import useSdk from '~/hooks/sdk'; import { useMemo } from 'react'; @@ -135,6 +136,7 @@ export function useChartSetupData() { const lpCharts: ChartSetupBase[] = []; const depositCharts: ChartSetupBase[] = []; const apyCharts: ChartSetupBase[] = []; + const seedCharts: ChartSetupBase[] = []; depositedTokensToChart.forEach((token) => { const depositedChart: ChartSetupBase = { @@ -219,6 +221,37 @@ export function useChartSetupData() { lpCharts.push(lpChart); }); + + depositedTokensToChart.forEach((token) => { + const seedChart: ChartSetupBase = { + name: `${token.symbol} Seed Value`, + tooltipTitle: `${token.symbol} Seeds`, + tooltipHoverText: `The number of seeds earned by ${ + token.symbol === 'BEAN' + ? 'Beans' + : token.symbol === 'urBEAN' + ? 'Unripe Beans' + : `${token.name}` + } at the beginning of every Season.`, + shortDescription: `The number of seeds per ${token.name}.`, + timeScaleKey: 'createdAt', + priceScaleKey: 'stalkEarnedPerSeason', + valueAxisType: 'seedValue', + document: SeedsPerSeasonDocument, + documentEntity: 'seasons', + queryConfig: { + variables: { + token: `${token.address}`, + }, + }, + valueFormatter: (value: any) => + Number(formatUnits(value, 6)), + tickFormatter: (value: any) => value.toFixed(4), + shortTickFormatter: tickFormatTruncated, + }; + + seedCharts.push(seedChart); + }); const output: ChartSetup[] = []; let dataIndex = 0; @@ -413,6 +446,7 @@ export function useChartSetupData() { const siloCharts: ChartSetupBase[] = [ ...depositCharts, + ...seedCharts, { name: `Stalk`, tooltipTitle: `Stalk`, From c6c38d13af63fbbb2df033425a209d4d5e226375 Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:25:53 +0200 Subject: [PATCH 2/5] update copy --- projects/ui/src/components/Analytics/useChartSetupData.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/projects/ui/src/components/Analytics/useChartSetupData.ts b/projects/ui/src/components/Analytics/useChartSetupData.ts index 6dd42dc6d0..d36298f03d 100644 --- a/projects/ui/src/components/Analytics/useChartSetupData.ts +++ b/projects/ui/src/components/Analytics/useChartSetupData.ts @@ -226,13 +226,7 @@ export function useChartSetupData() { const seedChart: ChartSetupBase = { name: `${token.symbol} Seed Value`, tooltipTitle: `${token.symbol} Seeds`, - tooltipHoverText: `The number of seeds earned by ${ - token.symbol === 'BEAN' - ? 'Beans' - : token.symbol === 'urBEAN' - ? 'Unripe Beans' - : `${token.name}` - } at the beginning of every Season.`, + tooltipHoverText: `The number of seeds earned per deposited ${token.name}.`, shortDescription: `The number of seeds per ${token.name}.`, timeScaleKey: 'createdAt', priceScaleKey: 'stalkEarnedPerSeason', From 0b207fcc6bf70cb366dc07261b7e4bc434294179 Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:45:07 +0200 Subject: [PATCH 3/5] update copy --- projects/ui/src/components/Analytics/useChartSetupData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/ui/src/components/Analytics/useChartSetupData.ts b/projects/ui/src/components/Analytics/useChartSetupData.ts index d36298f03d..b271da2e50 100644 --- a/projects/ui/src/components/Analytics/useChartSetupData.ts +++ b/projects/ui/src/components/Analytics/useChartSetupData.ts @@ -224,9 +224,9 @@ export function useChartSetupData() { depositedTokensToChart.forEach((token) => { const seedChart: ChartSetupBase = { - name: `${token.symbol} Seed Value`, + name: `${token.symbol} Seeds`, tooltipTitle: `${token.symbol} Seeds`, - tooltipHoverText: `The number of seeds earned per deposited ${token.name}.`, + tooltipHoverText: `The number of seeds per BDV rewarded to ${token.name} Deposits.`, shortDescription: `The number of seeds per ${token.name}.`, timeScaleKey: 'createdAt', priceScaleKey: 'stalkEarnedPerSeason', From 1855ee652a84d8342a3ade37f70101190ff29645 Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:29:25 +0200 Subject: [PATCH 4/5] change tokens in seed value chart --- projects/ui/src/components/Analytics/useChartSetupData.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/ui/src/components/Analytics/useChartSetupData.ts b/projects/ui/src/components/Analytics/useChartSetupData.ts index b271da2e50..cba3d62146 100644 --- a/projects/ui/src/components/Analytics/useChartSetupData.ts +++ b/projects/ui/src/components/Analytics/useChartSetupData.ts @@ -133,6 +133,11 @@ export function useChartSetupData() { BEAN_CRV3_V1_LP[1], ]; + const seedValueTokensToChart = [ + sdk.tokens.BEAN, + sdk.tokens.BEAN_ETH_WELL_LP + ]; + const lpCharts: ChartSetupBase[] = []; const depositCharts: ChartSetupBase[] = []; const apyCharts: ChartSetupBase[] = []; @@ -222,7 +227,7 @@ export function useChartSetupData() { lpCharts.push(lpChart); }); - depositedTokensToChart.forEach((token) => { + seedValueTokensToChart.forEach((token) => { const seedChart: ChartSetupBase = { name: `${token.symbol} Seeds`, tooltipTitle: `${token.symbol} Seeds`, From d377594759b4dbc38c923d77f8aba4ec813651ad Mon Sep 17 00:00:00 2001 From: Brean0 Date: Tue, 6 Aug 2024 18:37:35 +0200 Subject: [PATCH 5/5] add wsteth seed values. --- projects/ui/src/components/Analytics/useChartSetupData.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ui/src/components/Analytics/useChartSetupData.tsx b/projects/ui/src/components/Analytics/useChartSetupData.tsx index 612ebc898b..f7553de4bd 100644 --- a/projects/ui/src/components/Analytics/useChartSetupData.tsx +++ b/projects/ui/src/components/Analytics/useChartSetupData.tsx @@ -122,6 +122,7 @@ export function useChartSetupData() { sdk.tokens.BEAN, sdk.tokens.BEAN_CRV3_LP, sdk.tokens.BEAN_ETH_WELL_LP, + sdk.tokens.BEAN_WSTETH_WELL_LP, sdk.tokens.UNRIPE_BEAN, sdk.tokens.UNRIPE_BEAN_WSTETH, ]; @@ -129,6 +130,7 @@ export function useChartSetupData() { const lpTokensToChart = [ sdk.tokens.BEAN_CRV3_LP, sdk.tokens.BEAN_ETH_WELL_LP, + sdk.tokens.BEAN_WSTETH_WELL_LP, sdk.tokens.BEAN_ETH_UNIV2_LP, BEAN_LUSD_LP[1], BEAN_CRV3_V1_LP[1],