freemartianLock Time (Base & ETH)
    Updated 4 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
    block_timestamp,
    Last run: about 4 hours agoAuto-refreshes every 1 hour
    LABEL
    USERS
    $PRIME Amount
    1
    30 Months2275745041
    2
    12 Months49842625682
    3
    7 Months8922582648
    4
    5 Months5822364662
    5
    32 Months338401593
    6
    23 Months553167568
    7
    9 Months3931930577
    8
    Less Than 1 Month829486044
    9
    27 Months88981484623
    10
    35 Months306843145
    11
    31 Months2442266809
    12
    19 Months5015906
    13
    18 Months313995685
    14
    6 Months38076592577
    15
    1 Months56817215687.25
    16
    16 Months419452
    17
    25 Months2071042421
    18
    11 Months2701970823
    19
    13 Months183463127
    20
    3 Months56468579649
    37
    936B
    598s