Query editor
WITH mints AS (SELECT mints.block_time, collection, number_of_items, price.price, tx_hash, tx.gas_price / pow(10,18) * tx.gas_used AS gas_paid, tx_hash, tx.gas_price / pow(10,18) * tx.gas_used * price.price AS gas_price_usd, date_trunc('week', mints.block_time) AS weekFROM nft.mints mintsJOIN ethereum.transactions txON mints.tx_hash = tx.hashJOIN prices.usd priceON date_trunc('minute', mints.block_time) = price.minuteAND symbol = 'WETH'AND price.blockchain = 'ethereum'WHERE mints.block_time > cast('2022-06-01' AS timestamp)AND mints.blockchain = 'ethereum')SELECT week, avg(gas_price_usd) AS avg_price, stddev(gas_price_usd) AS stdev_price, approx_percentile(gas_price_usd, 0.5) AS median_priceFROM mintsGROUP BY 1ORDER BY week DESC