0-MIDTotal dex stats copy copy
Updated 2024-01-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 'ARB'as token
,date_trunc('week',BLOCK_TIMESTAMP) as week
,sum(AMOUNT_OUT_USD) as buy_volume
,count(distinct ORIGIN_FROM_ADDRESS) as buyers
,count(distinct TX_HASH) as buy_swaps
from arbitrum.defi.ez_dex_swaps
where BLOCK_TIMESTAMP::date>='2023-10-01'
and PLATFORM='uniswap-v3'
and SYMBOL_OUT='ARB'
group by 1,2),
tab2 as (
select 'OP'as token
,date_trunc('week',BLOCK_TIMESTAMP) as week
,sum(AMOUNT_OUT_USD) as buy_volume
,count(distinct ORIGIN_FROM_ADDRESS) as buyers
,count(distinct TX_HASH) as buy_swaps
from optimism.defi.ez_dex_swaps
where BLOCK_TIMESTAMP::date>='2023-10-01'
and PLATFORM='uniswap-v3'
and SYMBOL_OUT='OP'
group by 1,2)
select token
,round(avg(buyers)) as avg_buyers
,round(avg(buy_swaps)) as avg_buy_swaps
from tab1
group by 1
union all
select token
,avg(buyers) as avg_buyers
,avg(buy_swaps) as avg_buy_swaps
from tab2
group by 1
QueryRunArchived: QueryRun has been archived