MLDZMNstb5
    Updated 2023-02-17
    with tb2 as (
    select *,
    regexp_substr (sender,'[a-zA-Z]+|\d+') as source_chain,
    regexp_substr (receiver,'[a-zA-Z]+|\d+') as Destination_chain,
    CONCAT(source_chain,' -> ',Destination_chain) as Path_transfer
    from osmosis.core.fact_transfers
    where transfer_type in ('IBC_TRANSFER_IN','IBC_TRANSFER_OUT')
    and CURRENCY in ('ibc/8242AD24008032E457D2E12D46588FD39FB54FB29680C6C7663D296B383C37C4','ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858')
    and TX_SUCCEEDED = 'TRUE')

    select
    Path_transfer,
    PROJECT_NAME as stablecoin,
    count (distinct tx_id) as no_trabsfer,
    count (distinct sender) as no_senders,
    count(distinct RECEIVER) as no_receivers,
    sum(AMOUNT/1e6) as transfer_usd,
    avg(AMOUNT/1e6) as avg_transfer_usd
    from tb2 s left join osmosis.core.dim_tokens a on s.currency=a.ADDRESS
    group by 1,2
    QUALIFY DENSE_RANK() OVER (partition by stablecoin ORDER BY transfer_usd DESC) <= 10
    Run a query to Download Data