andurilOrca Top Swaps
    Updated 2022-05-26

    with top_swaps_from as (
    select
    swap_from_mint,
    count(distinct tx_id) as txs
    from solana.fact_swaps
    where
    date(block_timestamp) between '2022-03-01' and CURRENT_DATE()-2 and
    succeeded = 'TRUE' and
    swap_program = 'orca'
    group by 1
    order by 2 desc
    limit 10
    ),

    top_swaps_to as (
    select
    swap_to_mint,
    count(distinct tx_id) as txs
    from solana.fact_swaps
    where
    date(block_timestamp) between '2022-03-01' and CURRENT_DATE()-2 and
    succeeded = 'TRUE' and
    swap_program = 'orca'
    group by 1
    order by 2 desc
    limit 10
    ) ,

    swaps_add as (

    select 'Swap From' as type,dl.address_name, ts.txs as txs
    from top_swaps_from ts
    inner join solana.dim_labels dl
    on ts.swap_from_mint = dl.address

    Run a query to Download Data