SalehDo Whales Have Diamond Hands?-swap to
    Updated 2022-06-20
    with whales as
    (
    select trader, sum(from_amount/pow(10, from_decimal)) as swap_amount
    from osmosis.core.fact_swaps
    where from_currency = 'uosmo'
    and tx_status = 'SUCCEEDED'
    group by trader
    order by swap_amount desc
    limit 10
    )

    select
    date_trunc(week, block_timestamp::date) as date
    ,project_name as token
    , count(distinct tx_id) as swap_count
    ,sum(swap_count) over (partition by token order by date) as growth_swaps
    from osmosis.core.fact_swaps s
    join osmosis.core.dim_labels l on s.to_currency = l.address
    where trader not in (select trader from whales)
    and from_currency = 'uosmo'
    and to_currency <> 'uosmo'
    group by 1,2
    order by 1
    Run a query to Download Data