Skip to content

Commit

Permalink
fix: use timeframe volume instead of market.volume_24h
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
DanielSinclair committed Dec 23, 2024
1 parent 0f4f232 commit 4b3f1f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resources/trendingTokens/trendingTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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: {
Expand Down

0 comments on commit 4b3f1f7

Please sign in to comment.