freemartianThala - amnis Stake copy
    -- forked from Thala - amnis Stake @ https://flipsidecrypto.xyz/edit/queries/1c484ed3-b44f-4391-85bf-8de7dd4f4e03

    with thala_stake AS (
    SELECT
    block_number,
    block_timestamp,
    version,
    tx_hash,
    event_data:account AS sender,
    success,
    tx_type,
    payload_function,
    split_part(payload_function,'::',1) AS platform_address,
    'Thala' AS platform_name,
    event_index,
    event_type,
    event_module,
    event_resource,
    event_data:thAPT_staked AS thapt_amount_unadj,
    event_data:thAPT_staked/pow(10,8) AS thapt_amount,
    event_data:sthAPT_minted AS sthapt_amount_unadj,
    event_data:sthAPT_minted/pow(10,8) AS sthapt_amount,
    event_data

    FROM aptos.core.fact_events
    WHERE event_type = '0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::StakeThalaAPTEvent'
    AND payload_function = '0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::scripts::stake_thAPT' -- thala unstake payload functino
    AND success
    ),
    amnis_stake1 AS (
    SELECT
    tx_hash,
    event_resource,
    (event_data:amapt) AS amapt_amount_unadj,
    (event_data:amapt)/pow(10,8) AS amapt_amount,
    (event_data:stapt) AS stapt_amount_unadj,
    Run a query to Download Data