mohammadhflow 2
    Updated 2022-11-14
    with P as (select
    avg(PRICE_USD) as price,
    date_trunc('week',TIMESTAMP) as block_week
    from flow.core.fact_prices
    where SYMBOL = 'FLOW'
    group by block_week),


    A as (select
    date_trunc('week',block_timestamp) as block_week,
    count(distinct TX_ID) as tx_count,
    count(distinct DELEGATOR) as user_count,
    sum(AMOUNT) as sum_amount,
    avg(AMOUNT) as avg_amount
    from flow.core.ez_staking_actions
    where action in ('DelegatorTokensCommitted', 'TokensCommitted')
    group by block_week)

    select *
    from A join P on A.block_week=P.block_week





    Run a query to Download Data