mmdrezattap check copy
    Updated 5 hours ago
    -- forked from Hessish / ttap check @ https://flipsidecrypto.xyz/Hessish/q/X9WCZMQXAnsJ/ttap-check

    with
    acc_mapping as ( SELECT
    SIGNERS[0] as main_acc, SIGNERS[1] as playing_acc
    from eclipse.core.fact_transactions
    where
    block_timestamp::date >= '2024-12-01' and
    SIGNERS[0] = '{{Address}}' and
    SUCCEEDED = 'TRUE'
    and LOG_MESSAGES[0] like '%turboe9kMc3mSR8BosPkVzoHUfn5RVNzZhkrT2hdGxN%'
    and LOG_MESSAGES[1] = 'Program log: Instruction: GrantClicker'
    )


    SELECT
    count(DISTINCT tx_id) as "Total taps",
    signers[0] as "In-game address",
    count(DISTINCT tx_id) / count(DISTINCT date_trunc('second', block_timestamp)) as avg_sec,
    count(DISTINCT tx_id) / count(DISTINCT date_trunc('minute', block_timestamp)) as avg_min,
    count(DISTINCT tx_id) / count(DISTINCT date_trunc('hour', block_timestamp)) as avg_hour,
    count(DISTINCT tx_id) / count(DISTINCT date_trunc('day', block_timestamp)) as avg_day,

    COUNT(DISTINCT block_timestamp::date) AS "# days being active",
    max(block_timestamp::date) as "last playing date",
    min(block_timestamp::date) as "first playing date"
    from
    eclipse.core.fact_events
    join acc_mapping on "In-game address" = playing_acc
    where Main_acc = '{{Address}}' and
    block_timestamp::date >= '2024-12-01'
    and PROGRAM_ID = 'turboe9kMc3mSR8BosPkVzoHUfn5RVNzZhkrT2hdGxN'
    and SUCCEEDED = 'TRUE'
    Last run: about 5 hours ago
    No Data to Display
    0
    2B
    2s