Query editor
withxen_token1 as (selectdate_trunc('day', s.evt_block_time) as day,count(distinct to) as unique_users1,count(*) / count(distinct to) as avg_swaps_per_user1fromuniswap_v2_ethereum.Pair_evt_Swap sleft join uniswap_v2_ethereum.Factory_evt_PairCreated p on p.pair = s.contract_addressleft join tokens.erc20 t0 on t0.contract_address = p.token0left join tokens.erc20 t1 on t1.contract_address = p.token1wheres.contract_address = '{{Pair Address}}'and s.evt_block_time >= now() - interval '{{Month}}' monthgroup by1),xen_token2 as (selectdate_trunc('day', s.evt_block_time) as day,count(distinct to) as unique_users2,count(*) / count(distinct to) as avg_swaps_per_user2fromuniswap_v2_ethereum.Pair_evt_Swap sleft join uniswap_v2_ethereum.Factory_evt_PairCreated p on p.pair = s.contract_addressleft join tokens.erc20 t0 on t0.contract_address = p.token0left join tokens.erc20 t1 on t1.contract_address = p.token1wheres.contract_address = '{{Pair Address #2}}'and s.evt_block_time >= now() - interval '{{Month}}' monthgroup by1)SELECTx1.day,unique_users1 as Users_Pair_1,avg_swaps_per_user1 Avg_Swaps_Pair_1,unique_users2 as Users_Pair_2,avg_swaps_per_user2 as Avg_Swaps_Pair_2,(unique_users1/unique_users2)*1.0 as Pairs_Ratio_Per_Users_t1_t2FROMxen_token1 as x1JOIN xen_token2 as x2 on x1.day = x2.dayGROUP BY1,2,3,4,5ORDER BY1 DESC