bergRate of Swap from/Swap to of Uniswap at 2 weeks ago
    Updated 2022-12-08
    with swap_from as (
    select token0_symbol "Token",
    count (distinct (tx_hash)) "Swaps Count",
    sum(abs(amount0_usd)) "Volume (USD)"
    from ethereum.uniswapv3.ez_swaps
    where 1 = 1
    and token0_symbol is not null
    and token0_symbol in ('USDC', 'USDT', 'UNI', 'WETH', 'WBTC', 'MATIC')
    and block_timestamp >= current_date - interval '2 weeks'
    group by 1
    ),

    swap_to as (
    select token1_symbol "Token",
    count (distinct (tx_hash)) "Swaps Count",
    sum(abs(amount1_usd)) "Volume (USD)"
    from ethereum.uniswapv3.ez_swaps
    where 1 = 1
    and token1_symbol is not null
    and token1_symbol in ('USDC', 'USDT', 'UNI', 'WETH', 'WBTC', 'MATIC')
    and block_timestamp >= current_date - interval '2 weeks'
    group by 1
    )

    select
    "Token",
    (swap_to."Swaps Count" / swap_from."Swaps Count") as "Swap Ratio",
    (swap_to."Volume (USD)" / swap_from."Volume (USD)") as "Volume Ratio"
    from swap_from
    join swap_to
    using ("Token")
    Run a query to Download Data