Query editor
with execs as (selectevt_block_time,keeperId as keeper,compensation/1e18 as compensation_ETH,jobKey as job,evt_tx_hashfrom powerpool_base.PPAgentV2Randao_evt_Executewhere contract_address = 0xcD7D8e8Fe442253Fa65A3BFcdF12cdCD0013631aand evt_block_time >= current_timestamp - interval '30' day),txs as (select hash, (gas_price*gas_used + l1_fee)/1e18 as tx_fee_ETHfrom base.transactionswhere hash in (select evt_tx_hash from execs))--,--main as (selecte.evt_block_time,e.keeper,e.compensation_ETH-t.tx_fee_ETH as keeper_earned,--effective_gas_price*149600/1e18 as overhead_part,e.compensation_ETH,t.tx_fee_ETH,t.tx_fee_ETH*1e9 as tx_fee_gwei,--effective_gas_price as base_fee,e.job,e.evt_tx_hashfrom execs eleft join txs t on t.hash = e.evt_tx_hashorder by 1 desc/*)selectapprox_percentile(keeper_earned, array[0.1, 0.5, 0.9]) as keeper_earned,approx_percentile(compensation_ETH, array[0.1, 0.5, 0.9]) as compensation_ETH,approx_percentile(tx_fee_ETH, array[0.1, 0.5, 0.9]) as tx_fee_ETHfrom main*/