SniperBTC Amount
    Updated 2023-09-04
    with tb1 as (
    select
    trunc(block_timestamp::date, 'month') as monthly,
    sum(value) as Output_amount,
    count(DISTINCT tx_id) as Output_tx,
    avg(value) as avg_Output,
    sum(Output_amount) over (
    order by
    monthly asc
    ) as cum_Output
    from
    bitcoin.core.fact_outputs
    where
    PUBKEY_SCRIPT_ADDRESS = 'bc1qw8wrek2m7nlqldll66ajnwr9mh64syvkt67zlu'
    group by
    1
    ),
    tb2 as (
    select
    trunc(block_timestamp::date, 'month') as monthly,
    sum(value) * -1 as Input_amount,
    avg(value) as avg_Input,
    count(DISTINCT tx_id) as Input_tx,
    sum(Input_amount) over (
    order by
    monthly asc
    ) as cum_Input
    from
    bitcoin.core.fact_inputs
    where
    PUBKEY_SCRIPT_ADDRESS = 'bc1qw8wrek2m7nlqldll66ajnwr9mh64syvkt67zlu'
    group by
    1
    )
    select
    a.monthly,
    Run a query to Download Data