Query editor
withtvl as (selectpair_w_null,pool,tvlfrom (select*,row_number() over (partition by pool order by period desc) as rnfrom"query_5694078(blockchain='{{blockchain}}',version='{{version}}',filter_pools='{{filter_pools}}')"-- daily tvl per pool)where rn=1),volume as (selectp.pool,p.token0_address,p.token1_address,p.fee_in_percent,sum(amount_usd) filter (where t.block_time >= now() - interval '7' day) as l7d_vol,sum(amount_usd) filter (where t.block_time >= now() - interval '24' hour) as l24h_volfromdex.trades tleft joindune.uniswap_fnd.result_uniswap_v_4_all_pools_data pon p.pool = t.makerand p.blockchain = t.blockchainwhere t.block_time >= date('2025-01-21')and t.project = 'uniswap'and t.version = '{{version}}'and t.blockchain = '{{blockchain}}'group by 1,2,3,4),fee as (selectpool,sum(swap_fee_usd) filter (where block_time >= now() - interval '7' day) as l7d_fee,sum(swap_fee_usd) filter (where block_time >= now() - interval '24' hour) as l24h_feefrom (selectt.block_time,p.pool,t.amount_usd as swap_amount_usd,cast(t.amount_usd as double) * cast(f.fee / 1e6 as double) as swap_fee_usdfromuniswap_v4_{{blockchain}}.PoolManager_evt_Swap fjoindex.trades ton t.block_number = f.evt_block_numberand t.tx_hash = f.evt_tx_hashand t.evt_index = f.evt_indexand t.blockchain = '{{blockchain}}'and t.block_time >= date('2025-01-01')and t.project = 'uniswap'