Query editor
with events as (select t1.*from (select * from perp_v2_optimism.ClearingHouse_evt_LiquidityChangedwhere evt_block_time > now() - interval '{{days}}' day) t1 join (select * from optimism.transactionswhere block_time > now() - interval '{{days}}' day) t2 on t1.evt_tx_hash = t2.hashand bytearray_substring(t2.data, 1, 4) not in (0x18c298e1 -- openPositionFor))selectmaker,baseToken,count(1) as tx_cnt,sum(abs(base)) as sum_base,sum(abs(quote)) / int256 '1000000000000000000' as sum_quote,sum(quoteFee) / uint256 '1000000000000000000' as sum_fee ,if( sum(quoteFee) > uint256 '0', sum(abs(quote)) / sum(quoteFee) , 0) as quote_div_fee,avg(upperTick-lowerTick) as tick_range_avgfrom eventsgroup bymaker,baseTokenorder by tx_cnt desc