jackguyavg weekly fees
Updated 2023-07-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
›
⌄
SELECT
avg(fee_usd)
FROM (
SELECT
date_trunc('week', block_timestamp) as week,
'taproot_tx' as tx_type,
count(DISTINCT PARSE_JSON(outputs::STRING)[0]['scriptPubKey']['address']) as users,
count(DISTINCT TX_ID) as transactions,
sum(fee * price) as fee_usd,
avg(fee * price) as avg_fee_usd
FROM bitcoin.core.fact_transactions
LEFT outer join (
SELECT
date_trunc('day', hour) as day,
median(price) as price
FROM crosschain.core.fact_hourly_prices
WHERE token_address LIKE lower('0x2260fac5e5542a773aa44fbcfedf7c193bc2c599')
GROUP BY 1
) on day = date_trunc('day', block_timestamp)
WHERE block_timestamp > '2021-01-01'
--AND tx_id in (SELECT * FROM tab1)
GROUP BY 1,2
)
Run a query to Download Data