jackguyminer stuff
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
28
29
30
31
32
33
34
35
36
›
⌄
with tab1 as (
SELECT
DISTINCT tx_id
FROM bitcoin.core.fact_inputs
WHERE PUBKEY_SCRIPT_TYPE LIKE '%taproot%'
AND block_timestamp > '2022-01-01'
)
SELECT *
FROM (
SELECT
date_trunc('week', block_timestamp) as week,
'taproot_tx' as reward_type,
sum(fee * price) as amt_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 > '2022-01-01'
AND tx_id in (SELECT * FROM tab1)
GROUP BY 1,2
UNION
SELECT
date_trunc('week', block_timestamp) as week,
'other_tx' as reward_type,
sum(fee * price) as amt_usd
FROM bitcoin.core.fact_transactions
LEFT outer join (
Run a query to Download Data