freshgeek2024-06-09 10:43 PM
Updated 2024-06-11Copy 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
›
⌄
WITH transactions_all_time AS (
SELECT
TX_ID,
BLOCK_TIMESTAMP,
AMOUNT,
FLOW_WALLET_ADDRESS,
BLOCKCHAIN
FROM
flow.defi.ez_bridge_transactions
)
SELECT
COUNT(TX_ID) AS total_transactions,
BLOCKCHAIN,
COUNT(TX_ID) AS transactions_per_blockchain,
AVG(AMOUNT) AS average_amount_per_transaction,
COUNT(TX_ID) * 1.0 / COUNT(DISTINCT DATE_TRUNC('day', BLOCK_TIMESTAMP)) AS average_transactions_per_day
FROM
transactions_all_time
GROUP BY
BLOCKCHAIN
ORDER BY
transactions_per_blockchain DESC;
QueryRunArchived: QueryRun has been archived