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
101 changes: 0 additions & 101 deletions benchmarks/robinhood-subsidy.yml

This file was deleted.

35 changes: 34 additions & 1 deletion src/components/chain-kpi-strip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type CardDef = {
label: string;
value: number | null;
tip: string;
/** Optional formatter override; defaults to fmtUSD. */
fmt?: (v: number) => string;
};

export function ChainKpiStrip({
Expand All @@ -35,7 +37,32 @@ export function ChainKpiStrip({
tvlHistory?: ChainTvlHistory | null;
chainLabel: string;
}) {
const subsidyCards: CardDef[] = slug === "robinhood"
? [
{
label: "Gas subsidy days left",
value: kpis.subsidyDaysRemaining,
tip:
"Days remaining until Robinhood Chain's 90-day launch gas subsidy ends on 2026-09-29. Users pay $0 in gas during this window; Robinhood covers the sequencer cost.",
fmt: fmtDays,
},
{
label: "Subsidy paid so far",
value: kpis.subsidyCostToDate,
tip:
"Estimated cumulative USD Robinhood has paid the sequencer since launch to cover user gas. This is NOT growthepie's fees_paid_by_users (~$0 during the subsidy by design). Refreshed hourly.",
},
{
label: "Projected subsidy total",
value: kpis.subsidyProjectedTotal,
tip:
"Where the subsidy lands if the current daily burn rate holds through Sep 29. Linear projection: cumulative_cost x (90 / days_elapsed).",
},
]
: [];

const staticCards: CardDef[] = [
...subsidyCards,
{
label: "TVL",
value: kpis.tvl,
Expand Down Expand Up @@ -133,7 +160,7 @@ function KpiCard({ card }: { card: CardDef }) {
{card.label}
</p>
<p className="mt-auto text-lg sm:text-xl font-semibold tabular-nums leading-tight">
{fmtUSD(card.value!)}
{(card.fmt ?? fmtUSD)(card.value!)}
</p>
{/* Empty slot mirrors the live-card sparkline space so static and
live KpiCards share the exact same baseline geometry. */}
Expand All @@ -142,6 +169,12 @@ function KpiCard({ card }: { card: CardDef }) {
);
}

function fmtDays(v: number): string {
if (!Number.isFinite(v)) return "-";
if (v < 0) return "ended";
return `${Math.round(v)}d`;
}

function fmtUSD(v: number): string {
if (!Number.isFinite(v) || v === 0) return "$0";
const abs = Math.abs(v);
Expand Down
44 changes: 35 additions & 9 deletions src/lib/chain-kpis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export type ChainKpis = {
nativePrice: number | null;
/** Mobula native token circulating market cap in USD. */
nativeMcap: number | null;
/** Robinhood Chain gas subsidy: days remaining until 2026-09-29 (null on every other chain). */
subsidyDaysRemaining: number | null;
/** Robinhood Chain gas subsidy: cumulative USD Robinhood has paid the sequencer since launch. */
subsidyCostToDate: number | null;
/** Robinhood Chain gas subsidy: projected total cost at the current daily rate through Sep 29. */
subsidyProjectedTotal: number | null;
};

/** TVL daily samples for the sparkline chart. Last 30 days, oldest first. */
Expand Down Expand Up @@ -78,14 +84,28 @@ export async function fetchChainKpisFresh(
}

const sel = `{chain="${slug}"}`;
const [tvl, dexVolume24h, stablesMcap, nativePrice, nativeMcap] =
await Promise.all([
prom.scalar(`chain_tvl_usd${sel}`),
prom.scalar(`chain_dex_volume_24h_usd${sel}`),
prom.scalar(`chain_stables_mcap_usd${sel}`),
prom.scalar(`chain_native_price_usd${sel}`),
prom.scalar(`chain_native_mcap_usd${sel}`),
]);
const isRobinhood = slug === "robinhood";
const [
tvl,
dexVolume24h,
stablesMcap,
nativePrice,
nativeMcap,
subsidyDaysRemaining,
subsidyCostToDate,
subsidyProjectedTotal,
] = await Promise.all([
prom.scalar(`chain_tvl_usd${sel}`),
prom.scalar(`chain_dex_volume_24h_usd${sel}`),
prom.scalar(`chain_stables_mcap_usd${sel}`),
prom.scalar(`chain_native_price_usd${sel}`),
prom.scalar(`chain_native_mcap_usd${sel}`),
// Robinhood-only. On every other chain these queries return null,
// and the strip skips the cards silently.
isRobinhood ? prom.scalar(`robinhood_subsidy_days_remaining`) : Promise.resolve(null),
isRobinhood ? prom.scalar(`robinhood_subsidy_chainside_cost_total_usd`) : Promise.resolve(null),
isRobinhood ? prom.scalar(`robinhood_subsidy_projected_total_usd`) : Promise.resolve(null),
]);

return {
slug,
Expand All @@ -94,6 +114,9 @@ export async function fetchChainKpisFresh(
stablesMcap,
nativePrice,
nativeMcap,
subsidyDaysRemaining,
subsidyCostToDate,
subsidyProjectedTotal,
};
}

Expand Down Expand Up @@ -146,7 +169,10 @@ export function hasAnyKpi(k: ChainKpis | null): boolean {
k.dexVolume24h != null ||
k.stablesMcap != null ||
k.nativePrice != null ||
k.nativeMcap != null
k.nativeMcap != null ||
k.subsidyDaysRemaining != null ||
k.subsidyCostToDate != null ||
k.subsidyProjectedTotal != null
);
}

Expand Down
1 change: 0 additions & 1 deletion src/lib/removed-benches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const REMOVED_BENCH_SLUGS = new Set([
"tokenized-stock-peg",
"tokenized-stock-weekend-drift",
"tokenized-stock-arb-latency",
"robinhood-subsidy",
"xstocks-peg",
"usdy-nav-basis",
"portfolio-chain-coverage",
Expand Down
Loading