datavortexfees
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
›
⌄
WITH capybara_swaps AS (
SELECT
tx_hash
FROM kaia.defi.ez_dex_swaps
WHERE platform = 'capybara'
),
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
)
SELECT
SUM(f.tx_fee * p.klay_to_usd) AS total_capybara_tx_fee_usd,
AVG(f.tx_fee * p.klay_to_usd) AS avg_capybara_tx_fee_usd
FROM capybara_swaps s
JOIN transaction_fees f ON s.tx_hash = f.tx_hash
JOIN klay_price p;
QueryRunArchived: QueryRun has been archived