diff --git a/src/app/apps/page.tsx b/src/app/apps/page.tsx index c849bc20..7b9d9905 100644 --- a/src/app/apps/page.tsx +++ b/src/app/apps/page.tsx @@ -20,6 +20,8 @@ export const metadata: Metadata = pageMetadata({ export const revalidate = 300; +const WINDOWS = ["24h", "7d", "30d"] as const; + export default async function AppsHubPage() { const [evmData, solanaData, solPrice] = await Promise.all([ fetchEVMRevenue(), @@ -43,30 +45,39 @@ export default async function AppsHubPage() { const bscChain = evmRow?.chains["bsc"]; const baseChain = evmRow?.chains["base"]; + // EVM fees are always 24h — we don't have multi-window EVM data. const ethFees = ethChain ? ethChain.stable24h + (ethChain.native?.usd ?? 0) : null; const bscFees = bscChain ? bscChain.stable24h + (bscChain.native?.usd ?? 0) : null; const baseFees = baseChain ? baseChain.stable24h + (baseChain.native?.usd ?? 0) : null; + const evmTotal = (ethFees ?? 0) + (bscFees ?? 0) + (baseFees ?? 0); + + const windows: UnifiedAppRow["windows"] = {}; - let solanaFees: number | null = null; - if (solRow && solPrice !== null) { - const window24h = solRow.windows["24h"]; - if (window24h) { - solanaFees = (window24h.txCount * window24h.avgPlatformFeeLamports) / 1e9 * solPrice; + for (const w of WINDOWS) { + let solanaFees: number | null = null; + if (solRow && solPrice !== null) { + const wData = solRow.windows[w]; + if (wData) { + solanaFees = (wData.txCount * wData.avgPlatformFeeLamports) / 1e9 * solPrice; + } } + windows[w] = { + solana: solanaFees, + ethereum: ethFees, + bsc: bscFees, + base: baseFees, + total: (solanaFees ?? 0) + evmTotal, + }; } - const total24h = - (solanaFees ?? 0) + (ethFees ?? 0) + (bscFees ?? 0) + (baseFees ?? 0); - return { meta, - fees: { solana: solanaFees, ethereum: ethFees, bsc: bscFees, base: baseFees }, + windows, stableOnly: { ethereum: ethChain?.coverage === "stable-only", bsc: bscChain?.coverage === "stable-only", base: baseChain?.coverage === "stable-only", }, - total24h, }; }); @@ -101,7 +112,7 @@ export default async function AppsHubPage() {
Solana fees = txCount × avgPlatformFeeLamports / 1e9 × SOL price.
- EVM fees = stable (USDC/USDT) + native where traceable.{" "}
+ EVM fees = stable (USDC/USDT) + native where traceable, always 24h.{" "}
Detailed execution metrics →
diff --git a/src/components/trading-apps-leaderboard.tsx b/src/components/trading-apps-leaderboard.tsx
index ea80b9cf..d15ccc37 100644
--- a/src/components/trading-apps-leaderboard.tsx
+++ b/src/components/trading-apps-leaderboard.tsx
@@ -1,23 +1,27 @@
"use client";
import Image from "next/image";
+import Link from "next/link";
import { useState } from "react";
import { logoPath } from "@/lib/logo-manifest";
import type { AppMeta } from "@/lib/trading-apps-config";
+type FeeWindow = {
+ solana: number | null;
+ ethereum: number | null;
+ bsc: number | null;
+ base: number | null;
+ total: number;
+};
+
export type UnifiedAppRow = {
meta: AppMeta;
- fees: {
- solana: number | null;
- ethereum: number | null;
- bsc: number | null;
- base: number | null;
- };
+ windows: Record
° USDC only (no native trace on Base).
+ {window !== "24h" && " EVM fees are always 24h — only Solana has multi-window data."}
+
+ EVM fees (ETH/BSC/Base) are always 24h — only Solana has multi-window data.
#
App
Category
- Solana
+
+
+ Solana
+
+
Ethereum
BSC
Base
- Total 24h
+
+ Total {window}
+
{sorted.map((row, i) => {
- const { meta, fees, stableOnly } = row;
+ const { meta, stableOnly } = row;
+ const fees = row.windows[window] ?? { solana: null, ethereum: null, bsc: null, base: null, total: 0 };
const logo = meta.logoKey ? logoPath(meta.logoKey) : null;
return (
@@ -141,23 +179,37 @@ export function TradingAppsLeaderboard({
{i + 1}
-
- {logo && (
-
@@ -169,7 +221,7 @@ export function TradingAppsLeaderboard({
- {row.total24h > 0 ? fmtUSD(row.total24h) :
);
@@ -181,6 +233,12 @@ export function TradingAppsLeaderboard({
{hasStableOnly && (