Query editor
WITHkickback_txs AS (SELECTtime,value / 1e18 AS refund_eth,batch_value AS batch_value_usd,t.block_number,tx_hash AS settlement_tx,t.hash AS refund_txFROMcow_protocol_ethereum.batches AS batchINNER JOIN ethereum.blocks AS b ON batch.block_number = b.numberINNER JOIN ethereum.transactions AS t ON batch.block_number = t.block_numberAND b.hash = t.block_hashAND "from" = minerAND "to" = 0x0587d465FCD4A8212B66B96D99b41A8C16D4BD9bAND solver_address = 0x6bf97aFe2D2C790999cDEd2a8523009eB8a0823fWHEREb.time >= TIMESTAMP '{{start_date}}'AND b.time < TIMESTAMP '{{end_date}}')SELECTCOUNT(*) AS total_refund_txs,SUM(refund_eth) AS total_kickbacks_in_ethFROMkickback_txs