freemartianDaily Users - Base & Ethereum
    Updated 6 days ago
    WITH prices AS(
    SELECT
    hour::date AS price_day,
    AVG(price) AS price
    FROM ethereum.price.ez_prices_hourly
    WHERE token_address = '0xb23d80f5fefcddaa212212f028021b41ded428cf'
    AND hour::date >= '2024-06-01'
    GROUP BY 1
    ),

    current_prices AS(
    SELECT
    hour AS price_day,
    price,
    FROM ethereum.price.ez_prices_hourly
    WHERE token_address = '0xb23d80f5fefcddaa212212f028021b41ded428cf'
    AND hour = DATEADD(hour,-2,to_char(current_timestamp,'YYYY-MM-DD HH24:00:00'))

    ),

    eth_deposits AS (
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:user :: string AS user,
    decoded_log:amount / pow(10,18) AS amount,
    price * (decoded_log:amount / pow(10,18)) AS amount_usd,
    'Ethereum Deposit' AS label
    FROM ethereum.core.ez_decoded_event_logs
    INNER JOIN prices ON (block_timestamp::date = price_day)

    WHERE contract_address = '0x4a3826bd2e8a31956ad0397a49efde5e0d825238'
    AND event_name = 'DepositCreated'
    AND block_timestamp::date >= '2024-06-01'

    ),
    Last run: 6 days ago
    DAY
    USERS
    1
    2024-06-18 00:00:00.000135
    2
    2025-02-20 00:00:00.000155
    3
    2024-12-12 00:00:00.000162
    4
    2024-07-07 00:00:00.00013
    5
    2024-09-21 00:00:00.00012
    6
    2025-03-28 00:00:00.0001108
    7
    2024-12-15 00:00:00.00073
    8
    2025-03-10 00:00:00.000109
    9
    2024-07-20 00:00:00.00014
    10
    2024-12-23 00:00:00.000186
    11
    2025-01-14 00:00:00.000299
    12
    2025-02-18 00:00:00.000124
    13
    2024-07-11 00:00:00.00019
    14
    2024-08-28 00:00:00.00011
    15
    2025-01-24 00:00:00.000144
    16
    2025-01-08 00:00:00.000197
    17
    2025-01-15 00:00:00.000374
    18
    2024-06-16 00:00:00.00091
    19
    2024-07-02 00:00:00.00016
    20
    2024-12-07 00:00:00.000161
    ...
    317
    10KB
    51s