Query editor
with nft_transfer as (selectevt_block_time as day,evt_tx_hash as hash,count(evt_tx_hash) as transferfrom erc721_polygon.evt_Transferwhere contract_address = 0xfD257dDf743DA7395470Df9a0517a2DFbf66D156 --genesis mask contractand evt_block_time >=cast('2022-03-26' as timestamp) --contract start dategroup by 1,2),weth_transfers as (SELECTsum(cast(value as double))/1e18 as weth_value,evt_tx_hash as hashFROMerc20_polygon.evt_TransferWHEREcontract_address = 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619 and evt_block_time >=cast('2022-03-26' as timestamp) --contract start dateGROUP BYevt_tx_hash)--,--usdc_transfers as (-- SELECT-- sum(cast(value as double))/1e6 as usdc_value,-- evt_tx_hash as hash-- FROM-- erc20_polygon.evt_Transfer-- WHERE-- contract_address = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174-- GROUP BY-- evt_tx_hash-- )SELECT date_trunc('day', day) as "Time",approx_percentile(adj_value,0.05) as "Floor Price"--,min(amount_original) as "Floor Price",round(sum(weth_value)/sum(transfer), 3) as "Average Transaction Price",round(sum(weth_value),3) as "Volume"from(select nt.day, nt.hash, transfer,weth_value,weth_value/transfer as adj_value--,usdc_valuefrom nft_transfer ntleft join weth_transfers wt on nt.hash =wt.hash--left join usdc_transfers ut on nt.hash =ut.hashwhere weth_value is not null --or usdc_value is not null)where 1 <= {{Synchronize}}and cast(day as timestamp) > cast('{{Start Date}}' as timestamp)and cast(day as timestamp) < cast('{{End Date}}' as timestamp)group by 1order by 1 desc