Query editor
WITHtxs AS (SELECTdate_trunc('day',cast(substr(timestamp, 1, 10) as timestamp)) as date,hash,address,network,category,cast(gas_price as double) * cast(gas_used as double) * 1e18 as gas_spent_native_tokenFROM dune.azuro.result_raw_wallet_txs)SELECT*,CASEWHEN network = 'Arbitrum' THEN gas_spent_native_token * eth_priceWHEN network = 'Polygon' THEN gas_spent_native_token * matic_priceWHEN network = 'Chiliz' THEN gas_spent_native_token * chz_pricewhen network = 'Base' THEN gas_spent_native_token * eth_priceELSE gas_spent_native_tokenEND AS gas_spent_usdFROM txsLEFT JOIN query_3489370 -- pricesUSING (date)ORDER BY date DESC