NavidCopy of Copy of Untitled Query
    Updated 2022-11-15
    with trades as (
    select
    date(block_timestamp) as day,
    sum(AMOUNT/1e24) as amt,
    count(distinct tx_id) as trades_cnt,
    count(distinct tx_from) as sellers_cnt,
    count(distinct tx_to) as buyers_cnt
    from
    solana.core.fact_transfers
    group by 1
    )
    select
    day,
    amt as "Daily Volume",
    avg("Daily Volume") over (order by day asc rows between 7 preceding and current row) as "7-Day Moving Average",
    buyers_cnt/sellers_cnt as ratio
    from
    trades
    order by
    day asc

    Run a query to Download Data