Query editor
withsell as (select distinct trader_id, sum(amount_usd) as soldfrom dex_solana.tradeswheretoken_sold_mint_address = '{{Contract Address}}'and block_time > (current_timestamp - interval '{{day}}' day)group by trader_id), buy as (select distinct trader_id, sum(amount_usd) as boughtfrom dex_solana.tradeswheretoken_bought_mint_address = '{{Contract Address}}'and block_time > (current_timestamp - interval '{{day}}' day)and amount_usd > 999group by trader_id), accum as (select s.trader_id as trader, s.sold as amountfrom sell sleft join buy bon b.trader_id = s.trader_idwhere b.bought is nullgroup by s.trader_id, s.soldorder by s.sold desc), total_accum_traders as (select count(trader) from accum), total_accum_amount as (select sum(amount) from accum)SELECT'<a href="https://solscan.io/account/' || trader || '">' || trader || '</a>' AS trader_link,amountfrom accumcross join total_accum_traderscross join total_accum_amountorder by amount desc