binhachonSOL Swaps on Jupiter - Top 10
    Updated 2022-02-18
    with sol_swap_transactions as (
    select
    block_timestamp::date as blocktime,
    swap_from_amount,
    0 as swap_to_amount,
    swap_to_mint as token
    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,
    swap_from_mint as token
    from solana.swaps
    where block_timestamp::date >= '2022-01-01'
    and swap_to_mint = 'So11111111111111111111111111111111111111112'
    and swap_program ilike '%jupiter%'
    ),
    top10_in_volume as (
    select
    token,
    sum(swap_from_amount) + sum(swap_to_amount) as volume
    from sol_swap_transactions
    group by token
    order by volume desc
    limit 10
    )
    select
    blocktime,
    token,
    address_name,
    sum(swap_from_amount) as swap_from_volume,
    sum(swap_to_amount) as swap_to_volume,
    Run a query to Download Data