CryptoIcicleALGO-3. Tinyman Assets -N_Swaps
    Updated 2022-01-11
    -- Before the Tinyman hack, what were the most popular assets to swap with Algo in the
    -- Tinyman Dex[App ID 350338509]?
    -- Does the average amount of algo swapped changed based on the asset that it was swapped for?

    with assets as (
    (
    select
    asset_id,
    asset_name
    from
    algorand.asset
    )
    union
    select
    0,
    'Algo'
    ),
    tinyman_group_ids as (
    select
    distinct(tx_group_id) as tx_group_id
    from
    algorand.application_call_transaction
    where
    app_id = '350338509'
    ),
    tinyman_txns as (
    select
    rank() over (
    partition by tx_group_id
    order by
    intra desc
    ) as rank,
    a.asset_name as asset_name,
    t.*
    from
    algorand.transactions t
    Run a query to Download Data