binhachonSOL Swaps on Jupiter
    Updated 2022-02-18
    with sol_swap_transactions as (
    select
    block_timestamp::date as blocktime,
    swap_from_amount,
    0 as swap_to_amount
    from solana.swaps
    where block_timestamp::date >= '2022-01-01'
    and swap_from_mint = 'So11111111111111111111111111111111111111112'
    and swap_program ilike '%jupiter%'
    union all
    select
    block_timestamp::date as blocktime,
    0 as swap_from_amount,
    swap_to_amount
    from solana.swaps
    where block_timestamp::date >= '2022-01-01'
    and swap_to_mint = 'So11111111111111111111111111111111111111112'
    and swap_program ilike '%jupiter%'
    )
    select
    blocktime,
    sum(swap_from_amount) as swap_from_volume,
    sum(swap_to_amount) as swap_to_volume,
    swap_from_volume - swap_to_volume as sol_added_to_liquidity_pools_daily,
    sum(sol_added_to_liquidity_pools_daily) over (order by blocktime) as sol_added_to_liquidity_pools_total
    from sol_swap_transactions
    group by blocktime
    order by blocktime desc
    Run a query to Download Data