shadabbtc_txn_fee_users
Updated 2024-11-21
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 btc_price as (
SELECT
date_trunc('day', hour) as day,
avg(price) as btc_price
FROM
bitcoin.price.ez_prices_hourly
group by
1
),
new_users as (
SELECT
date_trunc('day', first_tx) as days,
count(DISTINCT PUBKEY_SCRIPT_ADDRESS) as new_users,
sum(new_users) over(
ORDER BY
days
) as cumulative_users
FROM
(
SELECT
PUBKEY_SCRIPT_ADDRESS,
min(block_timestamp) as first_tx
FROM
bitcoin.core.fact_outputs
GROUP BY
1
)
GROUP BY
1
)
SELECT
date_trunc(day, BLOCK_TIMESTAMP) as date,
count(*) as transactions,
btc_price,
new_users,
cumulative_users,
QueryRunArchived: QueryRun has been archived