MLDZMNFUR-DEX
    Updated 2022-12-20
    with t1 as (select
    'Flow' as blockchain,
    trader as users,
    count(distinct tx_id) as no_txn

    from flow.core.ez_swaps where block_timestamp >= '2022-01-01'
    group by 1,2

    union all

    select
    'Ethereum' as blockchain,
    ORIGIN_FROM_ADDRESS as users,
    count(distinct tx_hash) as no_txn

    from ethereum.core.ez_dex_swaps where block_timestamp >= '2022-01-01'
    group by 1,2
    union all

    select
    'Algorand' as blockchain,
    SWAPPER as users,
    count(distinct TX_GROUP_ID) as no_txn

    from algorand.defi.fact_swap where block_timestamp >= '2022-01-01'
    group by 1,2 having no_txn>0)

    SELECT
    blockchain,
    case
    when no_txn=1 then 'a. Just 1 swaps'
    when no_txn>1 and no_txn<=5 then 'b. 1-5 swaps'
    when no_txn>5 and no_txn<=10 then 'c. 5-10 swaps'
    when no_txn>10 and no_txn<=20 then 'd. 10-20 swaps'
    when no_txn>20 then 'e. Over 20 swaps'
    Run a query to Download Data