Moemaingas3
    Updated 2022-11-16
    (select
    'Osmosis ' as chain ,date,
    sum_fee_usd
    from
    (select
    block_timestamp::date date,
    avg(price) * sum(gas_used/1e9) as sum_fee_usd
    from
    osmosis.core.dim_prices
    inner join osmosis.core.fact_transactions
    on recorded_at::date=block_timestamp::date
    where symbol ='OSMO' and tx_from is not null
    and recorded_at::date >= current_date - 90
    and block_timestamp::date >= current_date - 90
    and tx_status='SUCCEEDED'
    group by 1))
    union all

    (select
    'Ethereum ' as chain ,date,
    sum_fee_usd
    from (with
    p as (select hour::date as date,
    avg (price) as price
    from ethereum.core.fact_hourly_token_prices
    where symbol ilike 'wETH'
    group by 1)
    select
    date_trunc('day', block_timestamp)::date as date ,
    sum (tx_fee*price) as sum_fee_usd
    from Ethereum.core.fact_transactions join p on block_timestamp::Date = date
    Run a query to Download Data