TOTAL_TRANSACTIONS | TOTAL_FEE_NEAR | TOTAL_FEE_USD | AVG_GAS_PER_SWAP_NEAR | |
---|---|---|---|---|
1 | 21504010 | 56839.886683 | 296138.442822156 | 0.01377131255 |
datavortexfees
Updated 2025-04-30
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 swap_transactions AS (
SELECT DISTINCT
s.tx_hash,
s.block_timestamp,
t.transaction_fee / 1e24 AS transaction_fee_near,
s.platform
FROM
near.defi.ez_dex_swaps s
JOIN near.core.fact_transactions t ON s.tx_hash = t.tx_hash
),
daily_near_prices AS (
SELECT
DATE_TRUNC('day', hour) AS day,
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY price) AS median_near_price_usd
FROM
near.price.ez_prices_hourly
WHERE
symbol = 'NEAR'
GROUP BY
DATE_TRUNC('day', hour)
)
SELECT
COUNT(DISTINCT s.tx_hash) AS total_transactions,
SUM(s.transaction_fee_near) AS total_fee_near,
SUM(s.transaction_fee_near * p.median_near_price_usd) AS total_fee_usd,
CASE
WHEN COUNT(DISTINCT s.tx_hash) > 0 THEN
SUM(s.transaction_fee_near * p.median_near_price_usd) / COUNT(DISTINCT s.tx_hash)
ELSE
NULL
END AS avg_gas_per_swap_near
FROM
swap_transactions s
JOIN daily_near_prices p
ON DATE_TRUNC('day', s.block_timestamp) = p.day
WHERE
Last run: about 1 month ago
1
56B
388s