csp88gActive Meteor wallets V2
    Updated 2024-12-09
    with meteor_wallets as (
    SELECT
    block_timestamp,
    TX_HASH,
    ARGS['new_account_id'] AS WALLET_ADDRESS
    FROM
    near.core.fact_actions_events_function_call
    WHERE
    METHOD_NAME = 'create_account'
    AND SIGNER_ID IN ('meteor-relayer.near', 'meteor-gastank.near' , 'aa-meteor-relayer-1.near', 'aa-meteor-relayer-2.near')
    AND block_timestamp::date >= '2023-11-06'
    /*and WALLET_ADDRESS = 'csp88.near'*/
    ),

    meteor_wallets_good as (
    select block_timestamp, RECEIVER_ID as WALLET_ADDRESS from near.core.fact_actions_events
    where ACTION_NAME = 'AddKey'
    and RECEIPT_SUCCEEDED = TRUE
    AND block_timestamp::date >= '2023-11-06'
    and TX_HASH in (select TX_HASH from meteor_wallets)
    ),

    last_activity as (
    select
    SIGNER_ID as wallet,
    CURRENT_DATE() - BLOCK_TIMESTAMP::date as inactive_days,
    *
    from near.core.fact_actions_events_function_call
    where wallet in (select WALLET_ADDRESS from meteor_wallets_good)
    /*or RECEIVER_ID = 'csp88.near'
    or PREDECESSOR_ID = 'csp88.near'*/
    /*qualify
    row_number() over (partition by wallet order by block_timestamp DESC) = 1*/
    )

    /*select * from last_activity*/
    QueryRunArchived: QueryRun has been archived