siavashjBTC Fees $ Yearly copy copy
Updated 2023-07-25
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_prices as (
select
date_trunc('month',hour) as b_day,
avg(price) as b_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WBTC'
and date_trunc('month',hour) >= '2010-01-01'
group by 1
),
prices as (
select
date_trunc('year',b_day) as days,
b_price
from btc_prices
),
inputs as (
select
date_trunc('year',block_timestamp) as date,
count(distinct tx_id) as "Input TXs",
count(distinct user) as "Input User",
sum(value) as "Input Amount BTC"
from (
select
i.block_timestamp,
i.tx_id,
outputs[0]:scriptPubKey:address as user,
value
from bitcoin.core.fact_inputs i join bitcoin.core.fact_transactions t
on i.tx_id = t.tx_id
where i.block_timestamp >= '2010-01-01'
) --join prices on days = date_trunc('year',block_timestamp)
where date_trunc('year',block_timestamp) >= '2010-01-01'
group by 1
),
outputs as (
select
Run a query to Download Data