m4ri4ncochoBinance Netflow
    Updated 2025-02-19
    -- BITCOIN DAILY NETFLOW

    -- INPUTS

    with inputs as (
    select
    date_trunc('day',block_timestamp) as date,
    pubkey_script_address as address,
    sum(value) as outflow
    from bitcoin.core.fact_inputs
    where date between '2023-03-20' and '2024-03-19'
    group by date, address
    ),

    -- OUTPUTS

    outputs as (
    select
    date_trunc('day', block_timestamp) as date,
    pubkey_script_address as address,
    sum(value) as inflow
    from bitcoin.core.fact_outputs
    where date between '2023-03-20' and '2024-03-19'
    group by date, address
    ),

    -- INPUTS+OUTPUTS

    merged as (
    SELECT
    date,
    address,
    -outflow as netflow
    from inputs
    union ALL
    SELECT
    Last run: 2 months ago
    DATE
    ENTITY
    NETFLOW
    1
    2023-03-20 00:00:00.000Binance5070.50123002
    2
    2023-03-21 00:00:00.000Binance-2057.67219332
    3
    2023-03-22 00:00:00.000Binance315.93653151
    4
    2023-03-23 00:00:00.000Binance1032.20455165
    5
    2023-03-24 00:00:00.000Binance-1863.08240205
    6
    2023-03-25 00:00:00.000Binance1080.5530762
    7
    2023-03-26 00:00:00.000Binance908.94206043
    8
    2023-03-27 00:00:00.000Binance-4621.03479313
    9
    2023-03-28 00:00:00.000Binance1078.51574857
    10
    2023-03-29 00:00:00.000Binance80.98292361
    11
    2023-03-30 00:00:00.000Binance4598.28127539
    12
    2023-03-31 00:00:00.000Binance234.30722742
    13
    2023-04-01 00:00:00.000Binance-471.70357125
    14
    2023-04-02 00:00:00.000Binance240.05152819
    15
    2023-04-03 00:00:00.000Binance1707.34827264
    16
    2023-04-04 00:00:00.000Binance-534.3960499
    17
    2023-04-05 00:00:00.000Binance1091.96448854
    18
    2023-04-06 00:00:00.000Binance1089.98022001
    19
    2023-04-07 00:00:00.000Binance1052.20073996
    20
    2023-04-08 00:00:00.000Binance479.86338588
    ...
    366
    19KB
    11s