Query editor
-- Column order here is important! Will be split up laterwith price_eth as (selectdate_trunc('day', timestamp) as day,pricefrom prices.daywhere blockchain = 'ethereum' and contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2and timestamp < current_dateand timestamp >= current_date - interval '{{days}}' day),native_transfers as (SELECTblock_date AS day,'native_transfer' as category_id,ROW(SUM((gas_used / POWER(10,18) * CAST(effective_gas_price AS DOUBLE)) + coalesce(l1_fee,0) / POWER(10,18)), -- gas_fees_ethROUND(SUM((gas_used / POWER(10,18) * price * CAST(effective_gas_price AS DOUBLE)) + coalesce(l1_fee,0) / POWER(10,18) * price),4), -- gas_fees_usdcount(*), -- txcountcount(distinct "from"), -- daasum(gas_used - gas_used_for_l1), -- gas_usedSUM(CASE WHEN success THEN 1 ELSE 0 END) * 1.0 / COUNT(*) -- success_rate (6th field, read by prepare_df_category_level_daily)) as metricsFROM robinhood.transactions tleft join price_eth p on t.block_date = p.dayWHERE block_date < current_dateAND block_date >= current_date - interval '{{days}}' dayAND "to" IS NOT NULLAND gas_used = 21000GROUP BY 1,2),contract_deployment as (SELECTblock_date AS day,'contract_deployment' as category_id,ROW(SUM((gas_used / POWER(10,18) * CAST(effective_gas_price AS DOUBLE)) + coalesce(l1_fee,0) / POWER(10,18)), -- gas_fees_ethROUND(SUM((gas_used / POWER(10,18) * price * CAST(effective_gas_price AS DOUBLE)) + coalesce(l1_fee,0) / POWER(10,18) * price),4), -- gas_fees_usdcount(*), -- txcountcount(distinct "from"), -- daasum(gas_used - gas_used_for_l1), -- gas_usedSUM(CASE WHEN success THEN 1 ELSE 0 END) * 1.0 / COUNT(*) -- success_rate (6th field, read by prepare_df_category_level_daily)) as metricsFROM robinhood.transactions tleft join price_eth p on t.block_date = p.dayWHERE block_date < current_dateAND block_date >= current_date - interval '{{days}}' dayAND "to" IS NULLGROUP BY 1,2),total_usage as (SELECT