Query editor
WITHaggregated_refund AS (SELECTtx_hash,SUM(value) AS refund_value_weiFROMdune.zyfi.result_paymaster_refundGROUP BYtx_hash),transactions_with_refund AS (SELECTt.paymaster_user AS user_address,(t.value - COALESCE(r.refund_value_wei, 0)) / 1e18 AS zyfi_gas_spendFROMdune.zyfi.result_paymaster_transactions AS tLEFT JOIN aggregated_refund AS r ON t.tx_hash = r.tx_hashWHEREt.value > COALESCE(r.refund_value_wei, 0)AND t.fee_sender IN (0x418F8EA78D856bEcf95e08C4A5773F5E85147866,0xA2Aac7bC9725c36ad9B12D2407dF8de6B2B68359,0xa2D1AE31C2236fBE054c6C9fBDEF27e78ac78D71,0x9702beC6668A94619a9c3cfef0e220512FbEEfbd))SELECTuser_address,SUM(zyfi_gas_spend) AS zyfi_gas_spentFROMtransactions_with_refundGROUP BYuser_addressORDER BYzyfi_gas_spent DESC;