cryptodatadiveTotal Netflow
    Updated 2025-04-06
    WITH
    D1 AS (
    SELECT DISTINCT
    contract_name,
    contract_address,
    origin_from_address AS depositor,
    CASE
    WHEN decoded_log:wad IS NOT NULL
    THEN (decoded_log:wad::int)
    ELSE (decoded_log:assets::int)
    END AS deposit_amount,
    tx_hash,
    block_timestamp
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name = 'Deposit'
    ),

    D2 AS (
    SELECT DISTINCT
    contract_name,
    contract_address,
    origin_from_address AS depositor,
    (decoded_log:assets[1]::int) AS deposit_amount,
    tx_hash,
    block_timestamp
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name = 'Deposits'
    ),

    prices AS (
    SELECT
    LOWER(name) AS name,
    LOWER(symbol) AS symbol,
    date_trunc('hour', hour) AS hour,
    price,
    decimals
    Last run: 19 days ago
    TOTAL_DEPOSITS_USD
    TOTAL_WITHDRAWALS_USD
    TOTAL_NETFLOW_USD
    1
    74305007.869320445338921.356225528966086.5130949
    1
    54B
    2s