sarathstaking_madness4
    Updated 2022-11-13
    select block_timestamp::date as date,
    case when swap_from_mint = 'So11111111111111111111111111111111111111112' then 'Swap From SOL'
    when swap_to_mint = 'So11111111111111111111111111111111111111112' then 'Swap To SOL' end as swap_type,
    count (distinct tx_id) as Swaps_Count,
    count (distinct swapper) as Swappers_Count,
    sum (case when swap_from_mint = 'So11111111111111111111111111111111111111112' then swap_from_amount
    when swap_to_mint = 'So11111111111111111111111111111111111111112' then swap_to_amount end) as Total_Volume,
    avg (case when swap_from_mint = 'So11111111111111111111111111111111111111112' then swap_from_amount
    when swap_to_mint = 'So11111111111111111111111111111111111111112' then swap_to_amount end) as Average_Volume
    from solana.core.fact_swaps
    where succeeded = 'TRUE'
    and (swap_from_mint = 'So11111111111111111111111111111111111111112' or swap_to_mint = 'So11111111111111111111111111111111111111112')
    and block_timestamp > CURRENT_DATE-14
    group by 1,2
    order by 1
    -- credits to alik
    Run a query to Download Data