Query editor
with trades as(selectDistinctdate_trunc('minute',"block_time") as minute, amount_original, amount_usd, token_id, cast(number_of_items as double) as number_of_items, tx_hashfrom nft.tradeswhere "nft_contract_address" = 0x7ddaa898d33d7ab252ea5f89f96717c47b2fee6e--check bundled transaction across OpenSea and LooksRare--and "tx_hash" = '\x052f2482e535f6917ddb18654c92b90b895ca1b1e2903125aadf9439aa7c8a04'), prices as (selectdate_trunc('minute',"minute") as minute,max("price") as "weth_price"from prices."usd"where "symbol" = 'WETH'--EVM startand "minute" >= cast('2022-04-01' as timestamp)group by 1), agg_trades as (selectdate_trunc('day',trades."minute") as day, token_id, number_of_items, sum(amount_usd/"weth_price") as eth, sum(amount_usd) as amount_usd, sum(amount_usd/"weth_price") / sum(number_of_items) as price_per_item_eth, sum(amount_usd) / sum(number_of_items) as price_per_item_usd, tx_hashfrom tradesleft join prices on date_trunc('minute',trades."minute") = prices."minute"group bydate_trunc('day',trades."minute"), token_id, number_of_items, tx_hash)selectday, sum(amount_usd) as usd, sum(sum(amount_usd)) over (order by day asc rows between unbounded preceding and current row) as cum_usd, sum(number_of_items) as num_trades, sum(sum(number_of_items)) over (order by day asc rows between unbounded preceding and current row) as cum_trades, avg(price_per_item_usd) as avg_usd--, percentile_cont(0.10) within group (order by price_per_item_usd) as floor_usd, approx_percentile(price_per_item_usd,0.10) as floor_usd, min(price_per_item_usd)as floor_usd, sum(eth) as eth, sum(sum(eth)) over (order by day asc rows between unbounded preceding and current row) as cum_eth, avg(price_per_item_eth) as avg_eth, approx_percentile(price_per_item_eth,0.10) as floor_eth--, percentile_cont(.100) within group (order by price_per_item_eth) as floor_ethfrom agg_tradesgroup by dayorder by day asc