mlhUntitled Query
Updated 2022-06-06Copy 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
›
⌄
WITH most_used_contracts AS (
SELECT TOP 10
COUNT(tx_id) AS use_count,
event_contract
FROM flow.core.fact_events
WHERE block_timestamp >= '2022-05-09'
GROUP BY event_contract
ORDER BY use_count DESC
),
trends AS (
SELECT
date_trunc('day', block_timestamp) AS day,
most_used_contracts.event_contract,
count(tx_id) AS use_count
FROM most_used_contracts LEFT JOIN flow.core.fact_events ON most_used_contracts.event_contract = flow.core.fact_events.event_contract
WHERE block_timestamp >= '2022-05-09'
GROUP BY day, most_used_contracts.event_contract
ORDER BY day
)
SELECT * FROM trends
Run a query to Download Data