diff --git a/src/lib/momentum/TopTradesTable.svelte b/src/lib/momentum/TopTradesTable.svelte index e09bce64b..0d4774350 100644 --- a/src/lib/momentum/TopTradesTable.svelte +++ b/src/lib/momentum/TopTradesTable.svelte @@ -3,6 +3,9 @@ Display table of trading pairs, linking each row to the trading pair details page. Format of pair records is based on the records returned by `top-momentum` API. +**Note:** The "Top trades" section was removed from the home page in 09/2024 (see #fb6486a3). +This component should be removed if it is not repurposed and displayed on a different page. + #### Usage: ```tsx diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index be9fb83f5..3bad5fa54 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -3,8 +3,7 @@ --> @@ -52,36 +51,6 @@ {/if} - {#if topMomentum} -
-

Today's top trades

- - - -
- {/if} - {#if posts}

Blog

diff --git a/src/routes/+page.ts b/src/routes/+page.ts index a0dee4707..26b1c690e 100644 --- a/src/routes/+page.ts +++ b/src/routes/+page.ts @@ -16,7 +16,6 @@ export async function load({ fetch, setHeaders, data }) { return { strategies: data.strategies, - topMomentum: await fetchPublicApi(fetch, 'top-momentum', { summary: 'true' }).catch(logError), impressiveNumbers: await fetchPublicApi(fetch, 'impressive-numbers').catch(logError), posts: await ghostClient.posts?.browse({ limit: 4 }).catch(logError) }; diff --git a/src/routes/FeaturedStrategies.svelte b/src/routes/FeaturedStrategies.svelte index ca32540b2..ba97b17cc 100644 --- a/src/routes/FeaturedStrategies.svelte +++ b/src/routes/FeaturedStrategies.svelte @@ -8,21 +8,11 @@ export let strategies: StrategyRuntimeState[]; - function calculateOpenStrategiesLiveDuration() { - const launchAt = new Date(2024, 3, 15); - const daysText = formatDaysAgo(launchAt.getTime() / 1000); - return daysText; - } - - const openLiveDays = calculateOpenStrategiesLiveDuration(); const chartDateRange = getStrategyChartDateRange(strategies); -
+

Open strategies

-

- Open strategies have been live for {openLiveDays}. -

diff --git a/src/routes/strategies/StrategyBadges.svelte b/src/routes/strategies/StrategyBadges.svelte deleted file mode 100644 index 0cb9fa6f3..000000000 --- a/src/routes/strategies/StrategyBadges.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -{#each tags as tag} - {@const isLive = tag === 'live'} - {#if !isLive || includeLive} - {tag} - {/if} -{/each} diff --git a/src/routes/strategies/StrategyTile.svelte b/src/routes/strategies/StrategyTile.svelte index acb4250eb..c26ecec59 100644 --- a/src/routes/strategies/StrategyTile.svelte +++ b/src/routes/strategies/StrategyTile.svelte @@ -7,7 +7,6 @@ import { getChain } from '$lib/helpers/chain.js'; import { Button, DataBadge, Tooltip } from '$lib/components'; import { StrategyIcon, StrategyError, shouldDisplayError, adminOnlyError } from 'trade-executor/components'; - import StrategyBadges from './StrategyBadges.svelte'; import ChartThumbnail from './ChartThumbnail.svelte'; import StrategyDataSummary from './StrategyDataSummary.svelte'; import { getLogoUrl } from '$lib/helpers/assets'; @@ -20,6 +19,12 @@ const chain = getChain(strategy.on_chain_data?.chain_id); + const tags = strategy.tags?.filter((tag) => tag !== 'live') ?? []; + const isLive = strategy.tags?.includes('live'); + + const launchedAt = strategy.summary_statistics?.launched_at; + const isNew = launchedAt ? utcDay.count(launchedAt, new Date()) < 90 : false; + const href = `/strategies/${strategy.id}`; const chartData = normalizeDataForInterval( @@ -50,40 +55,52 @@ {/if}
- {#if !simplified} -
- {#if shouldDisplayError(strategy, admin)} - - Error - - {#if adminOnlyError(strategy)} -

- This error is only displayed to admin users. -

- {/if} - -
-
- {/if} - - - - {#if strategy.new_version_id} - - Outdated - - This is an outdated strategy. An updated version is available - here. - - - {/if} -
- {/if} +
+ {#if !simplified && shouldDisplayError(strategy, admin)} + + Error + + {#if adminOnlyError(strategy)} +

+ This error is only displayed to admin users. +

+ {/if} + +
+
+ {/if} + + {#if !simplified && admin && isLive} + live + {/if} + + {#if isNew && !strategy.new_version_id} + new + {/if} + + {#if !simplified} + {#each tags as tag} + {tag} + {/each} + {/if} + + {#if !simplified && strategy.new_version_id} + + Outdated + + This is an outdated strategy. An updated version is available + here. + + + {/if} +
+
+
diff --git a/src/routes/strategies/[strategy]/+layout.svelte b/src/routes/strategies/[strategy]/+layout.svelte index 6b7079da7..b9635cb03 100644 --- a/src/routes/strategies/[strategy]/+layout.svelte +++ b/src/routes/strategies/[strategy]/+layout.svelte @@ -1,10 +1,9 @@