freemartianLock Time
    Updated 4 days 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: 4 days agoAuto-refreshes every 1 hour
    LABEL
    USERS
    $PRIME Amount
    1
    25 Months585596
    2
    16 Months13365
    3
    19 Months22670
    4
    18 Months773939
    5
    13 Months771698
    6
    14 Months25683
    7
    8 Months2285760
    8
    12 Months363933340
    9
    32 Months833630
    10
    5 Months1699266
    11
    3 Months2996166389
    12
    22 Months5132
    13
    Less Than 1 Month58014477
    14
    27 Months536157164
    15
    31 Months759481
    16
    35 Months482651
    17
    26 Months573052798
    18
    2 Months67139438
    19
    36 Months27818223
    20
    34 Months27308
    37
    850B
    330s