Pine AnalyticsUniswap 2
    Updated 2024-08-15
    select
    date_trunc('week', block_timestamp) as Date,
    'Ethereum' as Chain,
    count(distinct tx_hash) as Swaps,
    count(distinct ORIGIN_FROM_ADDRESS) as Swappers,
    sum(case when amount_out_usd is null then amount_in_usd else amount_out_usd end) as Swap_Volume_USD
    from ethereum.defi.ez_dex_swaps
    where platform in ('uniswap-v2', 'uniswap-v3')
    and block_timestamp > '2024-01-01'
    group by 1,2

    UNION ALL

    select
    date_trunc('week', block_timestamp) as Date,
    'Arbitrum' as Chain,
    count(distinct tx_hash) as Swaps,
    count(distinct ORIGIN_FROM_ADDRESS) as Swappers,
    sum(case when amount_out_usd is null then amount_in_usd else amount_out_usd end) as Swap_Volume_USD
    from arbitrum.defi.ez_dex_swaps
    where platform in ('uniswap-v2', 'uniswap-v3')
    and block_timestamp > '2024-01-01'
    group by 1,2

    UNION ALL

    select
    date_trunc('week', block_timestamp) as Date,
    'Optimism' as Chain,
    count(distinct tx_hash) as Swaps,
    count(distinct ORIGIN_FROM_ADDRESS) as Swappers,
    sum(case when amount_out_usd is null then amount_in_usd else amount_out_usd end) as Swap_Volume_USD
    from optimism.defi.ez_dex_swaps
    where platform in ('uniswap-v2', 'uniswap-v3')
    and block_timestamp > '2024-01-01'
    group by 1,2
    Last run: 13 days ago
    DATE
    CHAIN
    SWAPS
    SWAPPERS
    SWAP_VOLUME_USD
    1
    2024-07-22 00:00:00.000Ethereum16612562789149649615701.54
    2
    2024-07-22 00:00:00.000Arbitrum1264301900352385416595.19
    3
    2024-07-22 00:00:00.000Optimism35749534539234948819.12
    4
    2024-07-22 00:00:00.000BSC52475966693302433644.98
    5
    2024-07-22 00:00:00.000Base635460721032121614477437.37
    6
    2024-07-22 00:00:00.000Avalanche46609630166640189.7
    7
    2024-07-22 00:00:00.000Polygon1172302104303549328270.17
    8
    2025-03-31 00:00:00.000Ethereum11000451720766475134016.64
    9
    2025-02-17 00:00:00.000Ethereum12686022628589252770285.04
    10
    2024-03-25 00:00:00.000Ethereum136987837300511630843364.42
    11
    2024-03-25 00:00:00.000Arbitrum12312702039632146925640.97
    12
    2025-03-31 00:00:00.000Arbitrum1725280668692242726125.93
    13
    2025-02-17 00:00:00.000Arbitrum16732201152672773152240.65
    14
    2025-02-17 00:00:00.000Optimism44200961685137818965.92
    15
    2025-03-31 00:00:00.000Optimism4694643662377930351.74
    16
    2024-03-25 00:00:00.000Optimism46012893417503360958.66
    17
    2025-02-17 00:00:00.000BSC639104110435396755638
    18
    2024-03-25 00:00:00.000BSC448223157306760349088.34
    19
    2025-03-31 00:00:00.000BSC48747585137209702494.88
    20
    2025-03-31 00:00:00.000Base713329826804071439597831.28
    ...
    469
    30KB
    92s