MLDZMNdx11
    Updated 2022-09-16
    with tb1 as (select
    CONCAT(c.ADDRESS_NAME,' / ',b.ADDRESS_NAME) as asset_pairs,
    count(tx_id) as swaps,
    count(distinct swapper) as swappers
    --sum(swaps) over (partition by SWAP_PROGRAM order by day) as cum_swaps
    from solana.core.fact_swaps s join solana.core.dim_labels b on s.SWAP_TO_MINT=b.ADDRESS
    join solana.core.dim_labels c on s.SWAP_FROM_MINT=c.ADDRESS
    where SUCCEEDED='TRUE'
    and BLOCK_TIMESTAMP>= '2022-05-01'
    and c.ADDRESS_NAME!=b.ADDRESS_NAME
    group by 1
    order by 2 desc limit 10)

    select
    BLOCK_TIMESTAMP::date as day,
    CONCAT(c.ADDRESS_NAME,' / ',b.ADDRESS_NAME) as asset_pairs,
    count(tx_id) as swaps,
    count(distinct swapper) as swappers,
    sum(swaps) over (partition by asset_pairs order by day) as cum_swaps
    from solana.core.fact_swaps s join solana.core.dim_labels b on s.SWAP_TO_MINT=b.ADDRESS
    join solana.core.dim_labels c on s.SWAP_FROM_MINT=c.ADDRESS
    where SUCCEEDED='TRUE'
    and BLOCK_TIMESTAMP>= '2022-05-01'
    and asset_pairs in (select asset_pairs from tb1)
    group by 1,2
    order by 1


    Run a query to Download Data