Query editor
SELECTdate(blocK_time) as date,blockchain,project,MAX(blocK_time) as max_timestamp,COUNT(*) AS txn_count,COUNT(DISTINCT tx_hash) AS distinct_txn_count,SUM(casewhen blockchain = 'polygon' and currency_contract in (0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 0x0000000000000000000000000000000000001010) then CAST(amount_original AS DOUBLE)when blockchain = 'polygon' and currency_contract is null then CAST(amount_original AS DOUBLE) else 0 end) as matic_volume,SUM(casewhen blockchain = 'ethereum' and currency_contract in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0x0000000000000000000000000000000000000000) then CAST(amount_original AS DOUBLE)when blockchain = 'ethereum' and currency_contract is null then CAST(amount_original AS DOUBLE) else 0 end) as eth_volume,SUM(CAST(amount_usd AS DOUBLE)) AS usd_volume,COUNT(distinct buyer) As distinct_buyers,COUNT(distinct nft_contract_address) AS distinct_tokensFROMnft.tradesWHEREblock_time >= CURRENT_DATE - INTERVAL '14' DAYAND blockchain IN ('polygon', 'ethereum')GROUP BY1,2,3ORDER BY1 DESC