Salehj-k-s - s top 10 stablecoins and non-weekly
    Updated 2022-07-27
    with lst_top as (
    select top 10
    tr.mint as Token_check
    ,lb.LABEL
    ,count (DISTINCT tr.tx_id) as tx_count
    from solana.core.fact_transfers tr
    join solana.core.fact_events ev on tr.block_timestamp = ev.block_timestamp
    join solana.core.dim_labels lb on tr.mint = lb.address
    where program_id = 'SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC'
    group by 1,2
    order by tx_count desc
    )
    select
    date_trunc(week, tr.block_timestamp)::date as weekly
    , tr.mint as Token
    ,lb.LABEL
    ,count (DISTINCT tr.tx_id) as tx_count
    ,sum(tx_count) over (partition by Token order by weekly) as growth_tx_count
    from solana.core.fact_transfers tr
    join solana.core.fact_events ev on tr.block_timestamp = ev.block_timestamp
    join solana.core.dim_labels lb on tr.mint = lb.address
    where program_id = 'SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC'
    and Token in (select Token_check from lst_top)
    group by 1,2,3
    order by 1
    Run a query to Download Data