granadohoTop 20 Assets with Most Interaction
    Updated 2022-02-16
    with block as (
    select
    distinct block_id
    from algorand.block
    where date(block_timestamp) >= '2022-01-01'
    ), unique_address as (
    select
    a.address
    from algorand.account a
    inner join block b
    on a.created_at = b.block_id
    where a.created_at = b.block_id
    order by a.balance desc limit 200 -- top 200 richest wallet in algo
    ), clean_data as (
    select
    a.*,
    b.asset_name
    from algorand.transactions a
    inner join algorand.asset b
    on a.asset_id = b.asset_id
    where sender in (select * from unique_address)
    ), tx_count as (
    select
    asset_name,
    count(distinct tx_id) as tx_amount
    from (
    select
    case when asset_id = 0 then 'Algos'
    else asset_name end as asset_name,
    tx_id
    from clean_data
    )
    group by 1
    )

    select
    Run a query to Download Data