Query editor
with eth_price as (select minute, avg(price) as pricefrom prices.usdwhere blockchain='ethereum'and symbol = 'WETH'and minute >= timestamp '{{from_ts}}'and minute <= timestamp '{{to_ts}}'group by 1)select"from",sum((gas_price - base_fee_per_gas)*t.gas_used/1e18) as pri_fee_eth,sum((gas_price - base_fee_per_gas)*t.gas_used/1e18*price) as pri_fee_usd,min(block_time) as first_ts, max(block_time) as last_tsfrom ethereum.transactions tjoin ethereum.blocks b on b."number" = t.block_numberjoin eth_price p on p.minute = date_trunc('minute', t.block_time)where block_time >= timestamp '{{from_ts}}'and block_time <= timestamp '{{to_ts}}'and "from" in ({{wallet_addr}})-- and t.hash =0x0b68495b7dee5550099562daaf95306a624115bdb884343ccd44456ec20094b2-- example txgroup by 1