snowmanUntitled Query
    Updated 2022-11-15
    with roo as (
    select date_trunc('hour', recorded_hour)
    as hour,
    avg(close)
    as price
    from solana.core.fact_token_prices_hourly
    --from solana.core.fact_token_prices_hourly
    where symbol = 'SOL'
    and recorded_hour::date >=
    current_date - 30
    group by 1
    )
    select date_trunc('day', block_timestamp)
    as date,
    sum(price*fee/pow(10,9))
    as "Fee",
    avg(price)
    as "solana"
    from solana.core.fact_transactions
    inner join roo
    on date_trunc('hour', block_timestamp) =
    hour
    and block_timestamp::date >=
    current_date - 30
    group by 1
    Run a query to Download Data