Query editor
with total_market as(select blockchain, block_month, token_pair, sum(amount_usd) as vol from dex.tradeswhere block_month >= timestamp '2025-07-01'-- and blockchain='arbitrum'group by 1,2,3), uniswap_market as(select blockchain, block_month, token_pair, sum(amount_usd) as vol from dex.tradeswhere block_month >= timestamp '2025-07-01'-- and blockchain='arbitrum'and project='uniswap'group by 1 , 2,3), uniswap_v4_market as(select blockchain, block_month, token_pair, sum(amount_usd) as vol from dex.tradeswhere block_month >= timestamp '2025-07-01'-- and blockchain='arbitrum'and project='uniswap'and version= '4'group by 1 , 2,3),month_3_back as(select tm.blockchain, tm.block_month, tm.token_pair, tm.vol, um.vol as uniswap_volume, u4.vol as uniswap_v4_volume, um.vol / tm.vol as uniswap_share, u4.vol/tm.vol as uniswap_v4_sharefrom total_market tmleft join uniswap_market um on (tm.blockchain=um.blockchain and tm.block_month = um.block_month and tm.token_pair=um.token_pair)left join uniswap_v4_market u4 on (tm.blockchain=u4.blockchain and tm.block_month = u4.block_month and tm.token_pair=u4.token_pair)where tm.block_month= timestamp '2025-07-01'and um.block_month= timestamp '2025-07-01'and u4.block_month= timestamp '2025-07-01'),month_2_back as(select tm.blockchain, tm.block_month, tm.token_pair, tm.vol, um.vol as uniswap_volume, u4.vol as uniswap_v4_volume, um.vol / tm.vol as uniswap_share, u4.vol/tm.vol as uniswap_v4_sharefrom total_market tmleft join uniswap_market um on (tm.blockchain=um.blockchain and tm.block_month = um.block_month and tm.token_pair=um.token_pair)left join uniswap_v4_market u4 on (tm.blockchain=u4.blockchain and tm.block_month = u4.block_month and tm.token_pair=u4.token_pair)where tm.block_month= timestamp '2025-08-01'and um.block_month= timestamp '2025-08-01'and u4.block_month= timestamp '2025-08-01'),month_1_back as(select tm.blockchain, tm.block_month, tm.token_pair, tm.vol, um.vol as uniswap_volume, u4.vol as uniswap_v4_volume, um.vol / tm.vol as uniswap_share, u4.vol/tm.vol as uniswap_v4_sharefrom total_market tmleft join uniswap_market um on (tm.blockchain=um.blockchain and tm.block_month = um.block_month and tm.token_pair=um.token_pair)left join uniswap_v4_market u4 on (tm.blockchain=u4.blockchain and tm.block_month = u4.block_month and tm.token_pair=u4.token_pair)where tm.block_month= timestamp '2025-09-01'and um.block_month= timestamp '2025-09-01'and u4.block_month= timestamp '2025-09-01'),ranked as(selectm3.blockchain,m3.token_pair,m3.vol,