Query editor
WITHprices as (selectDATE_TRUNC('day', p.minute) AS day,AVG(p.price) as pricefromprices.usd pWHEREp.blockchain = 'ethereum'and p.symbol = 'WETH'group BY1order BYday desc)SELECTDATE_TRUNC('month', tx.block_time) AS month,CASEWHEN bytearray_starts_with (crf.token, crf.mintToken) then 'Mint'ELSE 'Swap'END as tx_type,COUNT(*) as txs_count,AVG(tx.gas_used) as avg_gas,AVG(tx.gas_price * tx.gas_used + tx.value) / 1e18 AS avg_spent_eth,AVG(p.price * (tx.gas_price * tx.gas_used + tx.value)) / 1e18 as avg_spent_usd,SUM(p.price * (tx.gas_price * tx.gas_used + tx.value)) / 1e18 as total_spent_usd,SUM(crf.fee) / 1e6 as total_fees_usdFROMethereum.transactions txJOIN synapse_ethereum.SynapseCCTP_evt_CircleRequestFulfilled crf ON tx.hash = crf.evt_tx_hashJOIN prices p ON p.day = DATE_TRUNC('day', tx.block_time)WHERE"from" = 0x0a1e1d0eb6A1cEF79e46F0e2d35B7bF2e958a26AGROUP BY1,2ORDER BYmonth DESC,tx_type ASC