From 4b3f1f701c0bab9dddc0f707588c42bd38ef0408 Mon Sep 17 00:00:00 2001 From: Daniel Sinclair Date: Mon, 23 Dec 2024 03:48:00 -0500 Subject: [PATCH] fix: use timeframe volume instead of market.volume_24h refactor --- src/resources/trendingTokens/trendingTokens.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/trendingTokens/trendingTokens.ts b/src/resources/trendingTokens/trendingTokens.ts index 4bbb62e9308..f9eba87c887 100644 --- a/src/resources/trendingTokens/trendingTokens.ts +++ b/src/resources/trendingTokens/trendingTokens.ts @@ -73,7 +73,7 @@ async function fetchTrendingTokens({ for (const token of response.trendingTokens.data) { const { uniqueId, address, name, symbol, chainId, decimals, trending, market, icon_url, colors } = token; - const { bought_stats } = trending.swap_data; + const { bought_stats, sold_stats } = trending.swap_data; const highlightedFriends = (bought_stats.farcaster_users || []).reduce((friends, friend) => { const { username, pfp_url } = friend; if (username && pfp_url) friends.push({ username, pfp_url }); @@ -93,7 +93,7 @@ async function fetchTrendingTokens({ day: trending.pool_data.h24_price_change || 0, }, marketCap: market.market_cap?.value || 0, - volume: market.volume_24h || 0, + volume: (bought_stats?.total_volume || 0) + (sold_stats?.total_volume || 0), highlightedFriends, icon_url, colors: {