RhoninFlow Speed p3
Updated 2022-06-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
›
⌄
WITH stats as (
SELECT
block_timestamp,
tx_id,
event_type
FROM flow.core.fact_events
WHERE block_timestamp >= '2022-05-09'
AND tx_succeeded = 'TRUE'
),
rank as (
SELECT
date_trunc('hour', block_timestamp) as hour,
event_type,
COUNT(DISTINCT tx_id) as txn,
RANK() OVER (PARTITION BY hour ORDER BY txn DESC) AS Ranks
from stats
WHERE event_type not in ('TokensDeposited', 'TokensWithdrawn', 'FeesDeducted')
GROUP BY 1,2
)
SELECT
hour,
txn,
event_type
from rank
WHERE ranks <=10
Run a query to Download Data