datavortexNew user growth rank
Updated 2024-12-17
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
›
⌄
WITH transaction_fees AS (
SELECT
tx_hash,
tx_fee
FROM kaia.core.fact_transactions
),
klay_price AS (
SELECT
price AS klay_to_usd
FROM kaia.price.ez_prices_hourly
WHERE symbol = 'KLAY'
ORDER BY hour DESC
LIMIT 1
),
platform_tx_fees AS (
SELECT
s.platform,
SUM(f.tx_fee * p.klay_to_usd) AS total_tx_fee_usd,
AVG(f.tx_fee * p.klay_to_usd) AS avg_tx_fee_usd
FROM kaia.defi.ez_dex_swaps s
JOIN transaction_fees f ON s.tx_hash = f.tx_hash
JOIN klay_price p ON TRUE
GROUP BY s.platform
)
SELECT
platform,
total_tx_fee_usd,
avg_tx_fee_usd,
RANK() OVER (ORDER BY avg_tx_fee_usd ASC) AS fee_rank
FROM platform_tx_fees
ORDER BY fee_rank;
QueryRunArchived: QueryRun has been archived