2844SWAP USDH TO TOKENS
    Updated 2022-10-10


    WITH swaps as (
    SELECT
    block_timestamp,
    swap_to_amount,
    swap_from_amount,
    swap_from_mint,
    swap_to_mint,
    swapper,
    tx_id,
    block_id,
    b.address_name,
    swap_program
    FROM solana.fact_swaps a
    INNER JOIN solana.dim_labels b
    ON a.swap_to_mint = b.address
    WHERE swap_from_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX'
    AND succeeded = 'TRUE'
    AND address_name is not NULL
    AND swap_from_amount > 0
    ),

    swap_stats as (
    SELECT
    swap_program,
    address_name,
    COUNT(tx_id) as txn,
    COUNT(swapper) as users,
    sum(swap_from_amount) as volume
    FROM swaps
    GROUP BY 1 ,2
    ORDER BY volume DESC

    )

    Run a query to Download Data