Afonso_Diaz2023-05-11 07:51 PM
Updated 2023-05-11
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
t as (
select
origin_from_address,
min(block_timestamp)::date as min_date
from polygon.core.ez_dex_swaps
where platform like 'uniswap%'
group by 1
),
t2 as (
select
origin_from_address as new_user
from t
where min_date > current_date - interval '12 months'
group by 1
),
t3 as (
select
tx_hash,
block_timestamp,
origin_from_address as user,
amount_in_usd as amount_usd
from polygon.core.ez_dex_swaps
where platform like 'uniswap%'
and block_timestamp > current_date - interval '12 months'
and origin_from_address in (select distinct new_user from t2)
),
t4 as (
select
user,
count(distinct tx_hash) as transactions,
sum(amount_usd) as volume_usd
Run a query to Download Data