SocioCryptoSOLANA: Top Assets in and out - Radar chart
    Updated 2023-04-13
    SELECT top 10 x.token as token_out_name, y.token as token_in_name,
    x.n_swappers as token_out,
    y.n_swappers as token_in,
    x.rank as rank_out,
    y.rank as rank_in,
    x.rank+y.rank as ranki
    FROM (
    SELECT top 20 CASE WHEN a.swap_to_mint = '2KE2UNJKB6RGgb78DxJbi2HXSfCs1EocHj4FDMZPr4HA' THEN 'slow protocol'
    WHEN a.swap_to_mint = 'DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ' THEN 'dust protocol'
    WHEN a.swap_to_mint = 'kiGenopAScF8VF31Zbtx2Hg8qA5ArGqvnVtXb83sotc' THEN'Genopets Ki'
    WHEN a.swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' THEN'usd coin'
    WHEN a.swap_to_mint = 'So11111111111111111111111111111111111111112' THEN'wrapped sol'
    WHEN a.swap_to_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' THEN'usdt'
    WHEN c.address_name is not null THEN c.address_name ELSE a.swap_to_mint END as token,
    count(DISTINCT a.tx_id) as n_swaps,
    COUNT(DISTINCT a.swapper) as n_swappers,
    rank()over(order by n_swappers DESC) as rank
    FROM solana.core.fact_swaps a
    LEFT JOIN solana.core.dim_labels c
    ON a.swap_from_mint = c.address
    WHERE succeeded = 'TRUE'
    AND date_trunc('day',a.block_timestamp) between CURRENT_DATE-30 AND CURRENT_DATE-1
    GROUP BY token
    ORDER BY n_swappers DESC
    ) x
    FULL OUTER JOIN (
    SELECT top 20 CASE WHEN a.swap_from_mint = '2KE2UNJKB6RGgb78DxJbi2HXSfCs1EocHj4FDMZPr4HA' THEN 'slow protocol'
    WHEN a.swap_from_mint = 'DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ' THEN 'dust protocol'
    WHEN a.swap_from_mint = 'kiGenopAScF8VF31Zbtx2Hg8qA5ArGqvnVtXb83sotc' THEN'Genopets Ki'
    WHEN a.swap_from_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' THEN'usd coin'
    WHEN a.swap_from_mint = 'So11111111111111111111111111111111111111112' THEN'wrapped sol'
    WHEN a.swap_from_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' THEN'usdt'
    WHEN c.address_name is not null THEN c.address_name ELSE a.swap_from_mint END as token,
    count(DISTINCT a.tx_id) as n_swaps,
    COUNT(DISTINCT a.swapper) as n_swappers,
    rank()over(order by n_swappers DESC) as rank
    Run a query to Download Data