Updated 2024-07-08
    with tab1 as (
    SELECT
    block_timestamp,
    'in' as flow,
    tx_to as user,
    amount
    FROM solana.core.fact_transfers
    where mint LIKE '2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo'
    and block_timestamp > '2024-03-01'
    union all
    SELECT
    block_timestamp,
    'out' as flow,
    tx_from as user,
    amount
    FROM solana.core.fact_transfers
    where mint LIKE '2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo'
    and block_timestamp > '2024-03-01'

    UNION all

    SELECT
    block_timestamp,
    'in' as flow,
    owner as user,
    mint_amount/ power(10, decimal) as amount
    FROM solana.defi.fact_token_mint_actions as a
    LEFT outer JOIN solana.core.fact_token_account_owners as b
    on b.ACCOUNT_ADDRESS = a.TOKEN_ACCOUNT
    where block_timestamp > '2024-03-01'
    AND mint LIKE '2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo'
    QueryRunArchived: QueryRun has been archived