cryptodatadivetotal deposits
    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
    FROM ethereum.price.ez_prices_hourly
    Last run: 20 days ago
    TOTAL_DEPOSIT_TRANSACTIONS
    TOTAL_DEPOSITORS
    TOTAL_DEPOSITS_USD
    AVG_DEPOSIT_AMOUNT_USD
    1
    14477151474305007.86932045132.624706039
    1
    46B
    3s