MoeFee stats
    Updated 2023-09-10
    select
    *
    from
    (
    (
    select
    'Osmosis ' as chain,
    round(total_fee_usd, 2) total_fee_usd,
    round(fee_per_tx, 4) fee_per_tx,
    round(fee_per_block, 4) fee_per_block
    from
    (
    select
    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,
    count(distinct BLOCK_ID) as block_count,
    total_fee_usd / block_count as fee_per_block
    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 >= '2023-08-15'
    and block_timestamp :: date >= '2023-08-15' --and tx_status='SUCCEEDED'
    )
    )
    union
    all (
    select
    'SEI ' as chain,
    round(total_fee_usd, 2) total_fee_usd,
    round(fee_per_tx, 4) fee_per_tx,
    round(fee_per_block, 4) fee_per_block
    from
    Run a query to Download Data