freemartianStake Distribution
    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
    (CASE
    WHEN minted_thapt < 1 THEN 'Less Than 1 APT'
    WHEN minted_thapt >= 1 AND minted_thapt <10 THEN 'Between 1 APT And 10 APT'
    WHEN minted_thapt >= 10 AND minted_thapt <100 THEN 'Between 10 APT And 100 APT'
    WHEN minted_thapt >= 100 AND minted_thapt <1000 THEN 'Between 100 APT And 1000 APT'
    WHEN minted_thapt >= 1000 AND minted_thapt <10000 THEN 'Between 1K APT And 10K APT'
    WHEN minted_thapt >= 10000 THEN 'More Than 10K APT'
    END
    ) AS Label,
    QueryRunArchived: QueryRun has been archived