sssstatisticContracts and DAU copy
Updated 2024-09-05Copy Reference Fork
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
›
⌄
-- forked from Contracts and DAU @ https://flipsidecrypto.xyz/studio/queries/79be232a-07b7-4df6-b719-1501d5cde3fc
with cname as (
select distinct contract_address, contract_name
from arbitrum.core.ez_decoded_event_logs
),
data as (
select
to_char(BLOCK_TIMESTAMP, 'YYYY-MM-DD') as time,
lb.contract_name,
count(DISTINCT ORIGIN_FROM_ADDRESS) AS Users,
count(DISTINCT TX_HASH) AS transactions,
count(DISTINCT TX_HASH) / count(DISTINCT ORIGIN_FROM_ADDRESS) AS "Average number of transactions per player"
from
arbitrum.core.fact_event_logs fl
left join cname lb
on lb.contract_address = fl.contract_address
where
BLOCK_TIMESTAMP < CURRENT_DATE
and
lb.contract_name is not null
GROUP by
to_char(BLOCK_TIMESTAMP, 'YYYY-MM-DD'),
lb.contract_name
)
select time,
RANK() OVER (PARTITION BY time ORDER BY Users DESC) AS Ranking,
contract_name,
Users,
transactions,
"Average number of transactions per player"
from data
ORDER BY
time DESC, Ranking
QueryRunArchived: QueryRun has been archived