theericstoneFees Spent using V2 vs V3
    with addresses as (
    select pool_address as address, 'v3' as iter from uniswapv3.pools
    union
    select distinct from_address as address, 'v2' as iter from ethereum.udm_events where from_label = 'uniswap' and LOWER(from_address_name) like '%v2%' and block_timestamp > getdate() - interval '90 days'
    union
    select distinct from_address as address, 'v3' as iter from ethereum.udm_events
    where from_address in (
    LOWER('0xC36442b4a4522E871399CD717aBDD847Ab11FE88'),
    LOWER('0xE592427A0AEce92De3Edee1F18E0157C05861564')
    ) and block_timestamp > getdate() - interval '90 days'
    ),

    v2 as (
    select * from (
    select
    date_trunc('hour',block_timestamp) as hour,
    function_name,
    count(*) as n_txns,
    avg(fee_usd) as mean_fee
    from
    ethereum.transactions
    where
    block_timestamp >= getdate() - interval '8 hours'
    and (
    LOWER(function_name) like 'swap%'
    OR LOWER(function_name) like '%liquidity%'
    OR LOWER(function_name) like '%claim%'
    OR LOWER(function_name) like '%deposit%'
    )
    and to_address in (select address from addresses where iter = 'v2')
    group by 1,2
    order by 1 desc)
    allofit where n_txns >= 100 and mean_fee > 0
    ),
    v3 as (
    select * from (
    Run a query to Download Data