datavortexultimate-moccasin
    Updated 2025-02-07

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

    /*
    WITH deposits AS (
    SELECT DISTINCT
    contract_name,
    contract_address,
    (decoded_log:assets[1]) 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
    WHERE LOWER(symbol) ILIKE '%swell%'
    )

    SELECT
    COUNT(DISTINCT d.tx_hash) AS total_deposit_transactions,
    COUNT(DISTINCT d.contract_address) AS total_depositors,
    SUM(d.deposit_amount) AS total_eth_deposited,
    SUM(
    CASE
    WHEN LOWER(p.symbol) = 'swell'
    QueryRunArchived: QueryRun has been archived