maybeyonasalgo_dex_dist_stats
    Updated 2022-03-23
    with
    swaps as (
    select
    tx_group_id as tx_id,
    swapper as user,
    swap_from_asset_id as from_asset,
    swap_to_asset_id as to_asset
    from algorand.swaps
    where block_timestamp >= '2022-01-01'
    and swap_from_amount > 0
    ),
    user_swaps as (
    select
    user,
    count(distinct tx_id) as txs,
    count(distinct from_asset) as from_asset,
    count(distinct to_asset) as to_asset
    from swaps
    group by 1
    )

    select
    'index',
    avg(txs),
    avg(from_asset),
    avg(to_asset),
    median(txs),
    median(from_asset),
    median(to_asset),
    sum(txs),
    sum(from_asset),
    sum(to_asset)

    Run a query to Download Data