Updated 2022-07-25
    with table1 as(

    select
    a.TX_ID,
    b.block_timestamp,
    d.value as signers,
    instructions[0]:parsed:info:amount::float / POW(10,6) AS "Token amount",
    pre_token_balances[3]:mint::string as source_address,
    address_name,
    inner_instructions[0]:instructions[2]:parsed:info:mint::string as "Destination Token",
    a.program_id as contract_address,
    ROW_NUMBER() OVER (partition by b.tx_id ORDER BY signers) as "row number"
    from solana.core.fact_events a
    inner join solana.core.fact_transactions b
    on a.tx_id = b.tx_id
    left join solana.core.dim_labels c on b.pre_token_balances[3]:mint::string = c.address,
    table(flatten(input => signers)) d
    WHERE a.program_id = 'SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC'
    and b.succeeded = 'TRUE'
    and b.block_timestamp >= '2022-06-01'
    )


    select
    date_trunc('day',block_timestamp) as days,
    sum ("Token amount") AS total_amount,
    count (Distinct signers) as total_unique_users,
    count (Distinct tx_id) as total_transaction_volume
    from table1
    where "row number"=1
    group by 1

    Run a query to Download Data