permaryPolygon
Updated 2024-10-17
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 polygon_data as (
select
date_trunc('day', block_timestamp) as date,
count(*) as total_txns
from polygon.core.fact_transactions
where block_timestamp between '2020-05-31' and '2020-06-30'
group by date
),
polygon_daily_unique_users as (
select
date_trunc('day', block_timestamp) as date,
address
from (
select block_timestamp, to_address as address
from polygon.core.fact_transactions
where block_timestamp between '2020-05-31' and '2020-06-30'
union all
select block_timestamp, from_address as address
from polygon.core.fact_transactions
where block_timestamp between '2020-05-31' and '2020-06-30'
) as combined_address
)
select
'polygon' as protocol,
pd.date,
pd.total_txns,
count(distinct pu.address) as unique_users,
(count(distinct pu.address)::float / pd.total_txns * 100) as adoption_rate
from polygon_data pd
left join polygon_daily_unique_users pu on pd.date = pu.date
group by pd.date, pd.total_txns
order by pd.date;
QueryRunArchived: QueryRun has been archived