Skip to content
Merged
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
11 changes: 7 additions & 4 deletions src/lib/curator/CuratorDescription.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ the vault protocol description widget. Sourced from the top-vaults dataset
<div class="description-text">
{#if curator.short_description || statsVaults.length}
<p>
{#if curator.short_description}{curator.short_description}{/if}
{#if statsVaults.length}
{curator.name} has
<strong>{vaultCountLabel}</strong>, with <strong>{totalTvlLabel}</strong>{#if averageApyLabel}{' '}and
<strong>{averageApyLabel}</strong> for the last 30 days{/if}.
{curator.name} has <strong>{vaultCountLabel}</strong> with
<strong>{totalTvlLabel}</strong>{#if averageApyLabel}
and a <strong>{averageApyLabel}</strong> over the last 30 days{/if}.
{/if}
{#if curator.short_description}
{' '}{curator.short_description}
{/if}
</p>
<p>The curator may have more vaults outside supported blockchains and vault protocols.</p>
{/if}
{#if hasExpandableContent}
<Button ghost class="toggle-btn" on:click={() => (expanded = !expanded)}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { error } from '@sveltejs/kit';
import { getCachedTopVaults } from '$lib/top-vaults/cache';
import { isBlacklisted, meetsMinTvl } from '$lib/top-vaults/helpers.js';
import { calculateTotalTvl, calculateTvlWeightedApy, isBlacklisted, meetsMinTvl } from '$lib/top-vaults/helpers.js';

export async function load({ params, fetch }) {
const { curator } = params;
Expand All @@ -12,13 +12,15 @@ export async function load({ params, fetch }) {
// aggregate stats for server-rendered SEO metadata; same eligibility rules
// as the curators index listing
const eligibleVaults = vaults.filter((v) => v.curator_slug === curator && !isBlacklisted(v) && meetsMinTvl(v));
const tvl = eligibleVaults.reduce((acc, v) => acc + (v.current_nav ?? 0), 0);
const tvl = calculateTotalTvl(eligibleVaults);
const averageApy = calculateTvlWeightedApy(eligibleVaults);

return {
curatorSlug: curator,
curatorName: curatorInfo.name,
curator: curatorInfo,
vaultCount: eligibleVaults.length,
tvl
tvl,
averageApy
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ with an "about" panel and a TVL/return mini chart.
import TopVaultsPage from '$lib/top-vaults/TopVaultsPage.svelte';
import { MetaTags, JsonLd } from 'svelte-meta-tags';
import VaultGroupMiniChart from '../../VaultGroupMiniChart.svelte';
import { formatDollar } from '$lib/helpers/formatters';
import { formatDollar, formatPercent } from '$lib/helpers/formatters';

let { data } = $props();
let { curatorSlug, curatorName, curator, vaultCount, tvl } = $derived(data);
let { curatorSlug, curatorName, curator, vaultCount, tvl, averageApy } = $derived(data);

let topVaults = $state<TopVaults>();
let totalVaultCount = $state<number>();
Expand Down Expand Up @@ -51,9 +51,13 @@ with an "about" panel and a TVL/return mini chart.
let title = $derived(`${curatorName} curated stablecoin vaults | Trading Strategy`);
let fullDescription = $derived.by(() => {
const stats =
vaultCount > 0 ? ` ${vaultCount} ${vaultCount === 1 ? 'vault' : 'vaults'} with ${formatDollar(tvl, 0)} TVL.` : '';
vaultCount > 0
? `${curatorName} has ${vaultCount} ${vaultCount === 1 ? 'vault' : 'vaults'} with ${formatDollar(tvl, 1)} TVL${
averageApy == null ? '' : ` and a ${formatPercent(averageApy, 1)} APY over the last 30 days`
}. The curator may have more vaults outside supported blockchains and vault protocols.`
: `Stablecoin vaults curated by ${curatorName}, ranked by returns and TVL.`;
const about = curator.short_description ? ` ${asSentence(curator.short_description)}` : '';
return `Stablecoin vaults curated by ${curatorName}, ranked by returns and TVL.${stats}${about}`;
return `${stats}${about}`;
});
// search-snippet meta description: same content clipped to fit; social cards
// and JSON-LD carry the full curator blurb
Expand Down Expand Up @@ -115,6 +119,7 @@ with an "about" panel and a TVL/return mini chart.
title="{curatorName} curated stablecoin vaults"
showFilters
defaultTvlKey="10k"
defaultHideUnknown={0}
defaultSort="tvl"
>
{#snippet detailAside()}
Expand Down
Loading