Moemaingas5 copy copy
    Updated 2023-09-12

    (select
    'Osmosis ' as chain ,
    sum(total_fee_usd) tot_fee_usd,
    avg(fee_per_tx) avg_fee_usd
    from
    (select
    block_timestamp::date date,
    count(distinct tx_id) as tx_count,
    avg(price) * sum(gas_used/1e9) as total_fee_usd,
    total_fee_usd/tx_count as fee_per_tx
    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 - 30
    and block_timestamp::date >= current_date - 30
    --and tx_status='SUCCEEDED'
    group by 1))
    union all

    -- (select
    -- 'Ethereum ' as chain ,
    -- sum(total_fee_usd) tot_fee_usd,
    -- avg(fee_per_tx) avg_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
    Run a query to Download Data