Query editor
with price as (select pricefrom prices.usd_latestwhere blockchain = 'sonic'and symbol = 'wS' -- find the native token price)SELECTdate_trunc('week', block_time) as week, avg((gas_price * gas_used) * (select price from price) /1e18) as avg_txn_cost, APPROX_PERCENTILE((gas_price * gas_used)/1e18 * (select price from price), 0.5) as median_txn_costFROM sonic.transactionsWHERE gas_price > 0 -- remove system txnsand block_time < date_trunc('week', NOW())and block_time >= date('2024-1-10') --base went live officially on Aug 9, so putting week start aka Aug 7 to start counting-- @TODO replace this ^^ with your own chain's launch dateGROUP BY 1