Updated 2023-12-03
    -- forked from part1 copy copy copy copy @ https://flipsidecrypto.xyz/edit/queries/9d6f24df-af21-48e6-b3f3-20e42b8b50d5

    -- forked from part1 copy copy copy @ https://flipsidecrypto.xyz/edit/queries/1b16d7a5-423c-4485-b889-20c2ed07f742

    -- forked from part1 copy copy @ https://flipsidecrypto.xyz/edit/queries/19cb3f93-fdfd-466f-bee7-3723df6f3c6c

    -- forked from part1 copy @ https://flipsidecrypto.xyz/edit/queries/ef30669e-4c26-46f3-8414-cafe6bcdb1d4

    with t as (
    select
    tx_id,
    block_timestamp,
    nvl(signers[1], signers[0]) as user,
    iff(pre.value:owner = 'FK1VcVh5PqEUm8U3aEz69DRSNSCjD6cMjzGx3KKbiE8', 'Fee', 'Subscribe') as type,
    (post.value:uiTokenAmount:amount - pre.value:uiTokenAmount:amount)/1e6 as amount_acs
    from solana.core.fact_transactions
    join lateral flatten (input => pre_token_balances) pre
    join lateral flatten (input => post_token_balances) post
    where log_messages::string ilike '%6HW8dXjtiTGkD4jzXs7igdFmZExPpmwUrRN5195xGup%'
    and log_messages::string ilike '%Program log: Instruction: Stake%'
    and succeeded = 1
    and pre.value:owner != user
    and pre.value:owner = post.value:owner
    )

    select * from t
    where block_timestamp::date >= '2023-11-01' and block_timestamp::date < '2023-12-05'





    Run a query to Download Data