onchain_shinobiETH CEX flow
    Updated 2025-03-10
    WITH cex_flows AS (
    -- CEX Inflows
    SELECT
    date_trunc('hour', block_timestamp) as block_hour,
    'inflow' as flow_type,
    sum(amount) as eth_amount,
    sum(amount_usd) as usd_amount
    FROM ethereum.core.ez_native_transfers t
    JOIN ethereum.core.dim_labels l
    ON t.to_address = l.address
    AND l.label_type = 'cex'
    AND l.label_subtype = 'hot_wallet'
    WHERE block_timestamp >= current_date() - 7
    GROUP BY 1

    UNION ALL

    -- CEX Outflows
    SELECT
    date_trunc('hour', block_timestamp) as block_hour,
    'outflow' as flow_type,
    sum(amount) as eth_amount,
    sum(amount_usd) as usd_amount
    FROM ethereum.core.ez_native_transfers t
    JOIN ethereum.core.dim_labels l
    ON t.from_address = l.address
    AND l.label_type = 'cex'
    AND l.label_subtype = 'hot_wallet'
    WHERE block_timestamp >= current_date() - 7
    GROUP BY 1
    )

    SELECT
    c.block_hour,
    c.flow_type,
    c.eth_amount,
    Last run: 3 months ago
    BLOCK_HOUR
    FLOW_TYPE
    ETH_AMOUNT
    USD_AMOUNT
    ETH_PRICE
    NET_ETH_FLOW
    NET_USD_FLOW
    1
    2025-03-10 20:00:00.000inflow15755.21712474229535517.771864.6925116.06315371347083827.82
    2
    2025-03-10 20:00:00.000inflow15755.21712474229535517.770.0038267325116.06315371347083827.82
    3
    2025-03-10 20:00:00.000outflow3197.1855478865993603.860.0038267325116.06315371347083827.82
    4
    2025-03-10 20:00:00.000outflow3197.1855478865993603.861864.6925116.06315371347083827.82
    5
    2025-03-10 19:00:00.000inflow107839.28528835206593110.80.0038962273495.333978124140798685.81
    6
    2025-03-10 19:00:00.000inflow107839.28528835206593110.87.950794132e-873495.333978124140798685.81
    7
    2025-03-10 19:00:00.000inflow107839.28528835206593110.81912.1273495.333978124140798685.81
    8
    2025-03-10 19:00:00.000outflow83340.840628975159660215.531912.1273495.333978124140798685.81
    9
    2025-03-10 19:00:00.000outflow83340.840628975159660215.530.0038962273495.333978124140798685.81
    10
    2025-03-10 19:00:00.000outflow83340.840628975159660215.537.950794132e-873495.333978124140798685.81
    11
    2025-03-10 18:00:00.000inflow95609.812445908191979722.837.950794132e-8-42396.943354658-85130942.3099999
    12
    2025-03-10 18:00:00.000inflow95609.812445908191979722.830.00407244-42396.943354658-85130942.3099999
    13
    2025-03-10 18:00:00.000inflow95609.812445908191979722.832010.23-42396.943354658-85130942.3099999
    14
    2025-03-10 18:00:00.000outflow109742.12689746220356703.67.950794132e-8-42396.943354658-85130942.3099999
    15
    2025-03-10 18:00:00.000outflow109742.12689746220356703.60.00407244-42396.943354658-85130942.3099999
    16
    2025-03-10 18:00:00.000outflow109742.12689746220356703.62010.23-42396.943354658-85130942.3099999
    17
    2025-03-10 17:00:00.000inflow90894.394916704184232939.890.004125527448.18239152955634444.82
    18
    2025-03-10 17:00:00.000inflow90894.394916704184232939.897.950794132e-827448.18239152955634444.82
    19
    2025-03-10 17:00:00.000inflow90894.394916704184232939.892026.6727448.18239152955634444.82
    20
    2025-03-10 17:00:00.000outflow81745.000786194165688124.950.004125527448.18239152955634444.82
    ...
    1132
    117KB
    10s