Query editor
with pool_info as (select 'Velodrome' as dex,'KWENTA-ETH (Velo)' as poolName,0xd65c1120ddf79f827b925c505949e02c5a0d6236 as pool,0x4200000000000000000000000000000000000006 as token0 --WETH,18 as decimals0,0x920cf626a271321c151d027030d5d08af699456b as token1 --KWENTA,18 as decimals1,array[0x4200000000000000000000000000000000000006, 0x920cf626a271321c151d027030d5d08af699456b] as poolTokens),swaps as (select i.pool,date_trunc('minute', s.evt_block_time) as time_at,token0 as token,cast(amount0In as double) as sizefrom velodrome_optimism.Pair_evt_Swap as sinner join pool_info as ion i.pool = s.contract_addressunion allselect i.pool,date_trunc('minute', s.evt_block_time) as time_at,token1 as token,cast(amount1In as double) as sizefrom velodrome_optimism.Pair_evt_Swap as sinner join pool_info as ion i.pool = s.contract_address),size as (select distinct ts.poolName,ts.pool,date_trunc('day', ts.time_at) as time_at,coalesce(ts.price, 0) * (coalesce(s.size, 0) / pow(10, ts.decimals)) as size_usdfrom (select distinct * from query_2199603) as tsleft join swaps as son ts.time_at = s.time_at and ts.pool = s.pool and ts.token = s.token) --select * from s-- BEFORE PALMselect 'Before PALM' as label,avg(size_usd) as avg_size,count(size_usd) as trades,sum(case when size_usd < 1000 then 1 else 0 end) as trades_1k,sum(case when 1000 <= size_usd and size_usd < 5000 then 1 else 0 end) as trades_5k,sum(case when 5000 <= size_usd and size_usd < 10000 then 1 else 0 end) as trades_10k,sum(case when size_usd >= 10000 then 1 else 0 end) as trades_10kplusfrom size as swhere date('2022-12-16') <= time_at and time_at < date('2023-02-24')group by 1union all-- PALM BOOTSTRAPselect 'PALM: Bootstraping',avg(size_usd),count(size_usd),sum(case when size_usd < 1000 then 1 else 0 end),sum(case when 1000 <= size_usd and size_usd < 5000 then 1 else 0 end),sum(case when 5000 <= size_usd and size_usd < 10000 then 1 else 0 end),sum(case when size_usd >= 10000 then 1 else 0 end)from size as s