CryptoIcicleAlgo-112.Swap Profiles In May & June - Assets - Algo Balance
    Updated 2022-07-08
    -- Swap Profiles In May & June
    -- Q112. Help us get a better idea of the wallets that are using the DEXs in May and June.

    -- Payout 233.386 ALGO
    -- Grand Prize 700.16 ALGO
    -- Level Intermediate

    -- Some of the things you can look at but should not be limited to:
    -- what assets do swappers hold,
    -- what is their ALGO balance,
    -- how often are they swapping,
    -- when was the wallet created.

    -- Tip:
    -- Use the swaps, account, and account_asset tables to guide your analysis.

    with swappers as (
    select
    distinct swapper
    from flipside_prod_db.algorand.swaps
    where block_timestamp between '2022-05-01' and '2022-06-30'
    ),
    balances as (
    select
    a.address as wallet,
    sum(balance) as balance
    from flipside_prod_db.algorand.account a
    join swappers s on a.address = s.swapper
    where balance >= 0
    group by 1
    )

    select
    count(distinct wallet) as n_wallets,
    CASE
    WHEN balance > 0 and balance <= 1 THEN 'a.0-1'
    Run a query to Download Data