freemartianTop Users
    Updated 2024-04-26
    with
    mint AS(
    SELECT
    block_timestamp,
    tx_hash,
    event_data:account AS wallet,
    (event_data:minted_thAPT)/pow(10,8) AS minted_thapt,
    (event_data:staked_APT)/pow(10,8) AS staked_APT,
    'mint'AS event
    FROM aptos.core.fact_events
    WHERE success
    AND event_type = '0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::StakeAPTEvent'
    ),

    redeem AS (
    SELECT
    block_timestamp,
    tx_hash,
    event_data:account AS wallet,
    (event_data:unstaked_amount)/pow(10,8) AS redeem_amount,
    'redeem'AS event
    FROM aptos.core.fact_events
    WHERE success
    AND event_type = '0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::CompleteUnstakeAPTEvent'
    )

    SELECT
    wallet,
    count(tx_hash) AS transactions,
    SUM(minted_thapt) AS thapt_amount
    FROM mint m
    GROUP BY 1
    ORDER BY 3 DESC


    QueryRunArchived: QueryRun has been archived