Query editor
with searcher as (selectdate_trunc('week', evt_block_time) as dt,count(distinct evt_tx_hash) as num_tx,-- avg(gas_price) as avg_gas_price,-- sum(fee_eth) as fee_eth,sum(fee_usd) as fee_usd,avg(fee_usd) as avg_fee_usdfrom query_2448618group by 1), total as (selectdate_trunc('week', block_time) as dt,count(distinct hash) as num_tx,-- avg(gas_price) / 1e9 as avg_gas_price,-- sum(fee_eth) as fee_eth,sum(cast(gas_price as double) / 1e18 * gas_used) as fee_usd,avg(cast(gas_price as double) / 1e18 * gas_used) as avg_fee_usdfrom arbitrum.transactions t-- left join (select * from prices.usd where blockchain = 'arbitrum' and symbol = 'WETH') p-- on date_trunc('minute', t.block_time) = p.minutewhere success and cast(gas_price as double) < 1e18 -- outlier detectionand date_trunc('day', block_time) <> TIMESTAMP '2022-04-27'and date_trunc('day', block_time) <> TIMESTAMP '2022-05-05'and date_trunc('day', block_time) <> TIMESTAMP '2022-08-20'group by 1)selects.dt,s.num_tx as searcher_num_tx,s.fee_usd as searcher_fee,s.avg_fee_usd as searcher_avg_fee,-- s.avg_gas_price as seacher_avg_gas_price,t.num_tx - s.num_tx as total_num_tx,t.fee_usd - s.fee_usd as total_fee,t.avg_fee_usd as total_avg_fee,-- t.avg_gas_price as total_avg_gas_price,cast(s.num_tx as double) / (t.num_tx - s.num_tx) as num_tx_ratio,cast(s.fee_usd as double) / (t.fee_usd - s.fee_usd) as fee_ratiofrom searcher sjoin total t on s.dt = t.dtwhere t.fee_usd < 1e12-- where s.dt <> TIMESTAMP '2021-09-27' and s.dt <> TIMESTAMP '2022-06-27' and s.dt <> TIMESTAMP '2022-07-11'