Pine Analyticsexotic-harlequin copy
    Updated 2025-05-05
    with tab1 as (
    SELECT
    block_timestamp,
    'Deposit' as flow,
    f.value['value'] as amount
    FROM bitcoin.core.fact_transactions,
    LATERAL FLATTEN(input => outputs) f
    WHERE block_timestamp > '2025-01-01';
    and f.value['scriptPubKey']['address'] = 'bc1pdwu79dady576y3fupmm82m3g7p2p9f6hgyeqy0tdg7ztxg7xrayqlkl8j9'
    ), tab2 as (
    select
    block_timestamp,
    'Withdraw' as flow,
    value as amount
    from bitcoin.core.fact_inputs
    where PUBKEY_SCRIPT_ADDRESS like 'bc1pdwu79dady576y3fupmm82m3g7p2p9f6hgyeqy0tdg7ztxg7xrayqlkl8j9'
    ), tab3 as (
    select
    date(block_timestamp) as date,
    flow,
    sum(amount) as volume,
    count(*) as events
    from (
    select * from tab1
    union all
    select * from tab2
    )
    group by 1,2
    order by 1 desc
    )


    select
    Last run: 25 days ago
    DATE
    FLOW
    VOLUME
    EVENTS
    VALUE_USD
    1
    2025-05-05 00:00:00.000Deposit99.23408572219378067.65392574
    2
    2025-05-05 00:00:00.000Withdraw85.44086606148074546.32656727
    3
    2025-05-04 00:00:00.000Withdraw108.927880632710411272.3666751
    4
    2025-05-04 00:00:00.000Deposit114.07550363410903279.5963362
    5
    2025-05-03 00:00:00.000Deposit170.384812553716404394.1750952
    6
    2025-05-03 00:00:00.000Withdraw174.665185513316816502.0631245
    7
    2025-05-02 00:00:00.000Withdraw278.395163355526972593.7963281
    8
    2025-05-02 00:00:00.000Deposit273.003268985626450194.7183963
    9
    2025-05-01 00:00:00.000Withdraw169.191236484916209197.2197299
    10
    2025-05-01 00:00:00.000Deposit181.16502645517356334.1892256
    11
    2025-04-30 00:00:00.000Deposit226.419394243821401840.4017475
    12
    2025-04-30 00:00:00.000Withdraw179.167870593216935484.6317786
    13
    2025-04-29 00:00:00.000Deposit203.722774774319328300.1176911
    14
    2025-04-29 00:00:00.000Withdraw193.904086223618396747.1321656
    15
    2025-04-28 00:00:00.000Deposit261.917250565024683212.6513997
    16
    2025-04-28 00:00:00.000Withdraw227.544827193921443938.2867992
    17
    2025-04-27 00:00:00.000Withdraw215.713573963920299725.8775058
    18
    2025-04-27 00:00:00.000Deposit205.388470243919328081.9919352
    19
    2025-04-26 00:00:00.000Deposit125.957214023411886141.4368183
    20
    2025-04-26 00:00:00.000Withdraw115.55785682510904790.4937172
    ...
    179
    12KB
    27s