cryptodatadiveDaily 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,
    DATE_TRUNC('day', block_timestamp) AS deposit_date
    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,
    DATE_TRUNC('day', block_timestamp) AS deposit_date
    FROM swell.core.ez_decoded_event_logs
    WHERE event_name = 'Deposits'
    ),

    -- Deduplicate prices to ensure only one price per token per day
    prices AS (
    SELECT
    LOWER(name) AS name,
    LOWER(symbol) AS symbol,
    DATE_TRUNC('day', hour) AS price_date,
    price,
    decimals,
    Last run: 20 days ago
    DEPOSIT_DATE
    TOTAL_DEPOSIT_TRANSACTIONS
    TOTAL_DEPOSITORS
    TOTAL_DEPOSITS_USD
    1
    2024-12-02 00:00:00.000510.00007334876132
    2
    2024-12-03 00:00:00.000391190218529.721206512
    3
    2024-12-04 00:00:00.00011962.0175
    4
    2024-12-05 00:00:00.0001167.8071633
    5
    2024-12-06 00:00:00.000331227.08992
    6
    2024-12-07 00:00:00.00022220.7799
    7
    2024-12-09 00:00:00.000110.361736525
    8
    2024-12-10 00:00:00.00011912.8375
    9
    2024-12-11 00:00:00.000111914.84
    10
    2024-12-12 00:00:00.000193139.959366172
    11
    2024-12-13 00:00:00.000110.0390075
    12
    2024-12-17 00:00:00.000330.6195480598
    13
    2024-12-18 00:00:00.000221.66643993
    14
    2024-12-19 00:00:00.0002412142487.87552452
    15
    2024-12-20 00:00:00.00020145218.680231617
    16
    2024-12-21 00:00:00.00013102741.55418218
    17
    2024-12-22 00:00:00.0001391441.522288298
    18
    2024-12-23 00:00:00.0005132142962.542504248
    19
    2024-12-24 00:00:00.0001812376864.281745431
    20
    2024-12-25 00:00:00.000411338833.5020993
    ...
    122
    6KB
    2s