Afonso_Diaz2023-06-01 - 2023-09-01
    Updated 2025-03-12
    -- Base CTE: Filter transactions involving KaiKai/Kaiching
    with storage_deposit as (
    select
    tx_hash,
    block_timestamp,
    action_data:args:account_id::string as user
    from
    near.core.ez_actions
    where
    tx_succeeded
    and receipt_predecessor_id = 'hotwallet.kaiching'
    and receipt_receiver_id = 'wallet.kaiching'
    and receipt_signer_id = receipt_predecessor_id
    and action_data:method_name = 'storage_deposit'
    and user is not null
    and block_timestamp between '2023-06-01' and '2023-09-01'
    ),

    earlier as (
    select
    tx_hash,
    block_timestamp,
    iff(tx_signer ilike '%.kaiching', tx_signer, tx_receiver) as user
    from
    near.core.fact_transactions
    where
    tx_succeeded
    and (
    tx_signer ilike '%.kaiching'
    or tx_receiver ilike '%.kaiching'
    )
    and block_timestamp between '2023-06-01' and '2023-09-01'
    ),

    main as (
    select
    QueryRunArchived: QueryRun has been archived