iboo-jbj2MVTop 5 most expensive ASAs
    Updated 2022-05-16
    with table1 as
    (select avg(price_usd)
    as average,
    asset_name as name,
    asset_id
    from algorand.prices_swap
    where block_hour::date = '2022-05-01'
    group by asset_id,
    name),
    table2 as
    (select * from (
    select swap_from_asset_id
    as asset
    from algorand.swaps
    where block_timestamp::date = '2022-05-01' union select swap_to_asset_id
    as asset
    from algorand.swaps
    where block_timestamp::date = '2022-05-01')
    group by asset)
    select name
    as name,
    row_number() over (order
    by table1.average desc)
    as r_number
    from table2
    join table1
    on table2.asset = table1.asset_id
    qualify r_number < 6
    Run a query to Download Data