datavortexNear Total
Updated 2024-12-09
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 total_seconds AS (
SELECT
366 * 24 * 60 * 60 AS total_seconds_in_2024
),
NEARPrice AS (
SELECT
AVG(price) AS near_price
FROM
near.price.ez_prices_hourly
WHERE
symbol = 'NEAR'
),
transaction_metrics AS (
SELECT
COUNT(DISTINCT tx_hash) AS total_transactions,
COUNT(DISTINCT tx_signer) AS active_users,
SUM(transaction_fee) / POW(10, 24) AS total_gas,
AVG(transaction_fee) / POW(10, 24) AS avg_transaction_fee,
COUNT(DISTINCT tx_hash) / (366 * 24 * 60 * 60) AS avg_transactions_per_second,
SUM(transaction_fee) / COUNT(DISTINCT tx_hash) / POW(10, 24) AS avg_gas_fee_per_transaction,
SUM(transaction_fee) / COUNT(DISTINCT tx_signer) / POW(10, 24) AS avg_gas_spent_per_user
FROM
near.core.fact_transactions
WHERE
block_timestamp >= '2024-01-01'
AND block_timestamp <= '2024-12-31'
AND tx_succeeded = TRUE
),
gas_conversion AS (
SELECT
tm.total_transactions,
tm.active_users,
tm.total_gas,
tm.avg_transaction_fee,
tm.avg_transactions_per_second,
tm.avg_gas_fee_per_transaction,
QueryRunArchived: QueryRun has been archived