aldo-camposTop tokens to swap from per month
    Updated 2022-04-07
    select label,
    sum(case when block_reference='2022-01-01 00:00:00.000' then total_transaction else 0 end)jan,
    sum(case when block_reference='2022-02-01 00:00:00.000' then total_transaction else 0 end)feb,
    sum(case when block_reference='2022-03-01 00:00:00.000' then total_transaction else 0 end)mar
    from
    (
    select block_reference,swap_from_mint,label,total_transaction,
    row_number()over(partition by block_reference order by total_transaction desc)rank
    from
    (
    select date_trunc('month',block_timestamp)block_reference,swap_from_mint,B.label,count(distinct tx_id)total_transaction,count(distinct swapper)total_unique_wallet
    from solana.fact_swaps A
    left join solana.dim_labels B on (B.address = A.swap_from_mint)
    where block_timestamp::date >= '2022-01-01'
    and swap_program in ('raydium v4')
    and succeeded='TRUE'
    --and tx_id='NKxjV79nUgvSTfUHAb4weKLKmAraf5wGAdda7TjBcKJBnRXeS5odD52XR5oo3UCAcriB5t9pRcVY1teWd94cXaj'
    group by date_trunc('month',block_timestamp),swap_from_mint,B.label
    ) A
    ) B
    where rank<=10
    group by label
    order by jan desc
    Run a query to Download Data