SELECT blockchain,
AVG(t.gas_price) as average_gas_price,
MEDIAN(t.gas_price) as median_gas_price,
AVG(tx_fee) as average_tx_fee,
MEDIAN(t.tx_fee) as median_tx_fee
FROM crosschain.defi.ez_dex_swaps s
JOIN ethereum.core.fact_transactions t ON s.tx_hash = t.tx_hash
AND blockchain = 'ethereum'
AND s.block_timestamp >= '2021-07-01'
GROUP BY blockchain