mohammadhCosmoverse Free Play)2buy(token category)
    Updated 2022-10-12
    with A as (
    select
    avg(PRICE) as price,
    date_trunc('day',RECORDED_AT) as block_day
    from osmosis.core.dim_prices
    where SYMBOL='SCRT'
    and (block_day >= '2022-10-01' and block_day < current_date -1)
    group by block_day),
    B as (select
    date_trunc('day',block_timestamp) as block_day,
    count(distinct TX_ID) as tx_count,
    count(distinct TRADER) as unique_user,
    sum(TO_AMOUNT/1e6) as volume,
    sum(tx_count) over (partition by PROJECT_NAME order by block_day asc) as cum_tx,
    sum(unique_user) over (partition by PROJECT_NAME order by block_day asc) as cum_unique_user,
    PROJECT_NAME,
    sum(volume) over (partition by PROJECT_NAME order by block_day asc) as cum_volume
    from osmosis.core.fact_swaps a
    join osmosis.core.dim_labels b
    on a.FROM_CURRENCY = b.ADDRESS
    where (block_day >= '2022-10-01' and block_day < current_date -1)
    and TO_CURRENCY ='ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
    and TX_STATUS ='SUCCEEDED'
    group by block_day,PROJECT_NAME)

    select * from (select
    B.block_day,
    tx_count,
    unique_user,
    volume,
    cum_tx,
    cum_unique_user,
    PROJECT_NAME,