Crazy_KidTinyman DEX Popularity 1
    Updated 2022-03-24
    WITH tiny AS (SELECT date(block_timestamp) as date1, count(DISTINCT tx_group_id) as tinyman_swap_count
    FROM algorand.swaps
    WHERE swap_program = 'tinyman' AND date1 >= '2022-01-01' AND swap_from_amount != 0
    GROUP BY date1
    ORDER BY date1),

    algofi AS (SELECT date(block_timestamp) as date2, count(DISTINCT tx_group_id) as algofi_swap_count
    FROM algorand.swaps
    WHERE swap_program = 'algofi' AND date2 >= '2022-01-01' AND swap_from_amount != 0
    GROUP BY date2
    ORDER BY date2),

    wagmi AS (SELECT date(block_timestamp) as date3, count(DISTINCT tx_group_id) as wagmiswap_swap_count
    FROM algorand.swaps
    WHERE swap_program = 'wagmiswap' AND date3 >= '2022-01-01' AND swap_from_amount != 0
    GROUP BY date3
    ORDER BY date3),

    pactfi AS (SELECT date(block_timestamp) as date4, count(DISTINCT tx_group_id) as pactfi_swap_count
    FROM algorand.swaps
    WHERE swap_program = 'pactfi' AND date4 >= '2022-01-01' AND swap_from_amount != 0
    GROUP BY date4
    ORDER BY date4)

    SELECT date1 as date, tinyman_swap_count, algofi_swap_count, wagmiswap_swap_count, pactfi_swap_count
    FROM tiny
    LEFT JOIN algofi ON date1 = date2
    LEFT JOIN wagmi ON date1 = date3
    LEFT JOIN pactfi on date1 = date4
    ORDER BY date
    Run a query to Download Data