Query editor
withPE as( SELECT date_trunc('day',minute) as day , avg(price) as price from prices.usd where symbol = 'ETH' and blockchain is null group by 1 order by day desc),A as( select evt_block_time as time, date_trunc('day',evt_block_time) as day,isBuy, supply, shareAmount, ethAmount/shareAmount/1e18 as price,ethAmount/1e18 as ethAmount, subjectEthAmount/1e18 as subjectEthAmount, subject, trader, evt_tx_hash as hashfrom friendtech_base.FriendtechSharesV1_evt_Tradewhere subject = {{Friend.Tech}}and cast(shareAmount as double) > 0order by time, supply)select *,sum(subjectEthAmount) over (order by time) as revenue,supply * price as marketcap,(select max(price) from A) as athfrom Aorder by time desc, supply