KaskoazulRAYDIUM TOP 10 TO
    Updated 2022-04-03
    with FIRSTJOIN as (
    select block_timestamp::date as fecha,
    tx_id,
    swap_from_mint,
    address_name as swap_from,
    swap_to_mint
    from solana.fact_swaps fs
    inner join solana.dim_labels dl
    on fs.swap_from_mint = dl.address
    where fecha >= '2022-01-01'
    and fecha < CURRENT_DATE - 1
    and swap_program = 'raydium v4'
    and succeeded = 'TRUE'
    ),

    SECONDJOIN as (
    select fecha,
    tx_id,
    swap_from_mint,
    swap_from,
    swap_to_mint,
    address_name as swap_to,
    concat_ws ('-',swap_from_mint, swap_to_mint) as swap_pair_mint,
    concat_ws ('-', swap_from, swap_to) as swap_pair
    from FIRSTJOIN fj
    inner join solana.dim_labels dl
    on fj.swap_to_mint = dl.address
    ),

    TOP10_FROM as (
    select count (tx_id) as swaps,
    swap_from,
    swap_from_mint
    from SECONDJOIN
    group by 2,3
    order by 1 desc
    Run a query to Download Data