Yousefi_1994Optimistic Sushi - Polygon weekly new user
Updated 2022-10-26
999
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
›
⌄
----------------------------------- Polygon -----------------------------------
with polygon_new_user as (
select
origin_from_address as from_address,
min(block_timestamp) as min_block_timestamp
from polygon.core.fact_event_logs
where origin_from_address != '0x0000000000000000000000000000000000000000'
and tx_status = 'SUCCESS'
group by from_address
having min_block_timestamp >= '2022-06-01'
),
polygon_count_new_user as (
select
date_trunc('week', min_block_timestamp) as "Weeks",
count(distinct from_address) as "Number of New User"
from polygon_new_user
group by "Weeks"
),
polygon_user_transactions as (
select
tx_hash,
origin_from_address as from_address,
min(block_timestamp) as min_block_timestamp
from polygon.core.fact_event_logs
where origin_from_address != '0x0000000000000000000000000000000000000000'
and origin_from_address in (select from_address from polygon_new_user)
and tx_status = 'SUCCESS'
group by tx_hash, from_address
),
polygon_user_transactions_and_rank as (
select
*,
row_number() over(partition by from_address order by min_block_timestamp) as row_num
from polygon_user_transactions
),
Run a query to Download Data