Query editor
WITH dex_trades AS (SELECTamount_usd,token_sold_amount_raw AS token_amount,block_timeFROM dex.tradesWHEREblockchain = 'polygon'AND "token_sold_address" = 0x264808855b0a6a5a318d238c6ee9f299179f27fcAND amount_usd > 0UNIONSELECTamount_usd,token_bought_amount_raw AS token_amount,block_timeFROM dex.tradesWHEREblockchain = 'polygon'AND "token_bought_address" = 0x264808855b0a6a5a318d238c6ee9f299179f27fcAND token_bought_amount > 0)SELECTSUM(amount_usd) AS volume_usd,(SUM(amount_usd) / TRY_CAST(SUM(token_amount) AS DOUBLE)) * 1e18 AS price_usd,DATE_TRUNC('day', block_time) AS time_1dayFROM dex_tradesGROUP BYDATE_TRUNC('day', block_time)ORDER BYtime_1day