jeneiukTop 10 $axlUSDC Transfer Path on Satellite (Based on Volume)
    Updated 2022-12-08
    --credit : @alik110
    -- Minor changes took place

    with case1 as (
    select *,
    regexp_substr (sender,'[a-zA-Z]+|\d+') as Sender_Chain,
    regexp_substr (receiver,'[a-zA-Z]+|\d+') as Receiver_Chain,
    Sender_Chain|| ' To ' || Receiver_Chain as Transfer_Path,
    lower (split(currency,'-')[0]) as Symbol1,
    iff (Symbol1 ilike 'u%',substring(Symbol1,2,LEN(Symbol1)), Symbol1) as Symbol
    from axelar.core.fact_transfers
    where transfer_type in ('IBC_TRANSFER_IN','IBC_TRANSFER_OUT')
    and currency = 'uusdc'
    and TX_SUCCEEDED = 'TRUE'),

    case2 as (
    select date_trunc (month,block_timestamp) as date,
    Transfer_Path,
    count (distinct tx_id) as Transfers_Count,
    sum ((amount/POW (10,decimal))) as Total_Volume,
    avg ((amount/POW (10,decimal))) as Average_Volume,
    median ((amount/POW (10,decimal))) as Median_Volume,
    min ((amount/POW (10,decimal))) as Minimum_Volume,
    max ((amount/POW (10,decimal))) as Maximum_Volume
    from case1
    group by 1,2),

    case3 as (
    select *,
    row_number() over (partition by date order by Transfers_Count desc) as RN
    from case2)

    select * from case3
    where RN <= 10
    order by date

    Run a query to Download Data