Updated 2022-11-17
    with a as(select
    date_trunc('hour',block_timestamp) date,
    count(tx_id) transaction,
    sum(fee)/pow(10,9) fee
    from solana.core.fact_transactions
    where block_timestamp >= CURRENT_DATE - 90
    group by 1
    ),b as(
    select RECORDED_HOUR,close
    from solana.core.fact_token_prices_hourly where id='5426' and RECORDED_HOUR>= CURRENT_DATE - 90
    ),c as(
    select
    date,
    close,
    transaction,
    fee ,
    fee*close usd_fee
    from a join b on a.date=b.RECORDED_HOUR
    )
    select
    date_trunc('day',date) date,
    avg(close) sol_price,
    sum(transaction) transaction,
    sum(fee) fee ,
    sum(usd_fee) usd_fee
    from c
    group by 1
    Run a query to Download Data