majidgholamiMost popular stable coin & non-stable coin
    Updated 2022-07-27
    with stables as(
    select inner_instructions[0]:instructions[2]:parsed:info:mint as top_st_coin ,(sum (POST_TOKEN_BALANCES[1]:uiTokenAmount:uiAmount)) as volume
    from solana.core.fact_transactions
    where inner_instructions[0]:instructions[2]:parsed:info:mint ='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' /* USDC*/ or inner_instructions[0]:instructions[2]:parsed:info:mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'-- USDT )
    group by top_st_coin order by volume desc
    limit 1
    ),
    unstables as (
    select inner_instructions[0]:instructions[2]:parsed:info:mint as top_unst_coin ,(sum (POST_TOKEN_BALANCES[1]:uiTokenAmount:uiAmount)) as volume1
    from solana.core.fact_transactions
    where inner_instructions[0]:instructions[2]:parsed:info:mint = 'AFbX8oGjGpmVFywbVouvhQSRmiW2aR1mohfahi4Y2AdB' /* GST*/ or inner_instructions[0]:instructions[2]:parsed:info:mint = '7i5KKsX2weiTkry7jA4ZwSuXGhs5eJBEjY8vVxR4pfRx'-- GMT )
    group by top_unst_coin order by volume1 desc
    limit 1
    ),
    stabless as (
    select top_unst_coin as popular
    from unstables
    UNION
    select top_st_coin from stables
    )
    --labeling
    select ADDRESS_NAME as top_coins
    from solana.core.dim_labels
    where ADDRESS in (select popular from stabless)

    Run a query to Download Data