freemartianLock Time
    Updated 23 hours ago

    with
    prices AS(
    SELECT
    hour,
    price,
    symbol,
    ROW_NUMBER() OVER (ORDER BY hour DESC) AS row_num
    FROM base.price.ez_prices_hourly
    WHERE symbol ilike 'PRIME'
    AND hour::date = current_date
    qualify row_num = 1
    ),

    base_deposit_temp AS (
    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address as user,
    regexp_substr_all(SUBSTR(data, 3, len(data)), '.{64}') AS temp_data,
    ethereum.public.udf_hex_to_int(temp_data[0] :: STRING) AS depositIndex,
    ethereum.public.udf_hex_to_int(temp_data[1] :: STRING)/pow(10,18) AS amount,
    to_timestamp(ethereum.public.udf_hex_to_int(temp_data[3] :: STRING)) AS createdTimestamp,
    to_timestamp(ethereum.public.udf_hex_to_int(temp_data[2] :: STRING)) AS endTimestamp,
    DATEDIFF(DAY, createdTimestamp, endTimestamp) AS difference_in_days,
    from base.core.fact_event_logs
    -- where tx_hash in ('0xf7977ba798badd22d56d0f5576124e5f4f911bb66168ea8f0b8f3770850d7b3d')
    WHERE origin_function_signature = '0xf104489f'
    AND block_timestamp::date >= '2024-06-01'
    AND origin_to_address = '0xfa980ced6895ac314e7de34ef1bfae90a5add21b'
    AND contract_address IN ('0x75a44a70ccb0e886e25084be14bd45af57915451','0xfa980ced6895ac314e7de34ef1bfae90a5add21b')
    AND ARRAY_SIZE(temp_data) = 4
    ),

    base_deposits AS(
    SELECT
    Last run: about 23 hours agoAuto-refreshes every 1 hour
    LABEL
    USERS
    $PRIME Amount
    1
    7 Months1888809
    2
    27 Months390152199
    3
    31 Months759481
    4
    14 Months22677
    5
    8 Months1435185
    6
    2 Months53133612
    7
    21 Months91666
    8
    9 Months926211
    9
    33 Months551029
    10
    3 Months1990147265
    11
    36 Months27818223
    12
    26 Months7515301
    13
    28 Months89743695
    14
    13 Months671508
    15
    11 Months614532
    16
    29 Months320755140
    17
    16 Months8279
    18
    35 Months482651
    19
    19 Months18641
    20
    24 Months57010912
    37
    843B
    89s