saeedmznWhat's All The Hubbub for Hubble Protocol? - swaps over time
    Updated 2022-10-11
    select date_trunc(week,block_timestamp)::date weekly,
    case when swap_from_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' then 'swap_from_USDH'
    when swap_to_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' then 'swap_to_USDH'
    end swap_type ,
    count (distinct tx_id) num_swaps,
    count (distinct swapper) num_swappers,
    sum (iff( swap_from_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' , swap_from_amount , swap_to_amount )) swapped_volume,
    sum (num_swaps) over (partition by swap_type order by weekly) cum_swaps ,
    sum (swapped_volume) over (partition by swap_type order by weekly) cum_swapped_volume
    from solana.core.fact_swaps
    where (swap_from_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' or swap_to_mint= 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' )
    and succeeded = true
    group by 1,2

    Run a query to Download Data