Pine AnalyticsUniswap 1
Updated 2024-08-15
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with tab1 as (
select
date_trunc('week', block_timestamp) as Date,
'Ethereum' as Chain,
count(distinct tx_hash) as Swaps,
count(distinct sender) 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 sender) 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 sender) 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'
QueryRunArchived: QueryRun has been archived