Query editor
-- Column order here is important! Will be split up laterwith price_pol as (selectdate_trunc('day', timestamp) as day,max(price) as pricefrom prices.daywhere blockchain = 'ethereum' and contract_address in (0x455e53cbb86018ac2b8092fdcd39d8444affc3f6, 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0) -- POL, MATICand timestamp < current_dateand timestamp >= current_date - interval '{{days}}' dayGROUP BY 1),price_eth as (selectdate_trunc('day', timestamp) as day,pricefrom prices.daywhere blockchain = 'ethereum' and contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- ETHand timestamp < current_dateand timestamp >= current_date - interval '{{days}}' day),prices as (selectpol.day,pol.price as price_pol,eth.price as price_eth,pol.price/eth.price as pol_per_ethfrom price_pol polinner join price_eth eth on pol.day = eth.day),native_transfers as (SELECTblock_date AS day,'native_transfer' as category_id,ROW(SUM((gas_used / POWER(10,18) * CAST(gas_price AS DOUBLE)) * pol_per_eth), -- gas_fees_ethROUND(SUM((gas_used / POWER(10,18) * price_pol * CAST(gas_price AS DOUBLE))),4), -- gas_fees_usdcount(*), -- txcountcount(distinct "from"), -- daasum(gas_used) -- gas_used) as metricsFROM polygon.transactions tleft join prices p on t.block_date = p.dayWHERE block_date < current_dateAND block_date >= current_date - interval '{{days}}' dayAND "to" IS NOT NULLAND gas_used = 60000GROUP BY 1,2),contract_deployment as (SELECTblock_date AS day,'contract_deployment' as category_id,ROW(