Query editor
-- C0CA opponent revenue report (BNB Chain).---- Parameter:-- hours rolling lookback window, e.g. 8---- Accounting model for this opponent:-- * collector ERC-20/native receipts are strategy revenue;-- * outer tx.value is NOT the bribe (normally zero/dust);-- * builder/refund payments are native BNB calls made by the executor;-- * gas is paid by the transaction sender;-- * economic net = collector revenue - internal BNB payments - gas.---- Blox BackRunMe splits have dynamic recipients. For a transaction identified-- by a payment to the BackRunMe contract, direct executor BNB outflows are-- counted after excluding the known WBNB/V4 settlement endpoints. For normal-- bundles, only known builder payment endpoints are counted. This prevents-- WBNB wrapping and payable V4 settlement calls from being mislabeled bribes.WITHparams AS (SELECTcast(8 AS bigint) AS hours,0xc0ca1bde7339a71709878acb4477b1d072eacf00 AS collector,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c AS wbnb,0x238a358808379702088667322f80ac48bad5e6c4 AS cake_v4_settlement,0x28e2ea090877bf75740558f6bfb36a5ffee9e9df AS pancake_v4_manager,0x3a9440cd61e7c8399bfba0834056ea0d157a743c AS backrunme),candidate_txs AS (SELECTt.hash,t.block_number,t.block_time,t."to" AS executor,t.gas_used,t.gas_price,t.valueFROM bnb.transactions tCROSS JOIN params pWHERE t.block_time >= now() - interval '1' hour * p.hoursAND t.block_date >= date(now() - interval '1' hour * p.hours) - interval '1' dayAND t.successAND t."to" IN (0x2d19bdd4557866810ee2ec5946112c4f10a90fdb,0x9ac2695c95a73c66015745c39cecba1e064bf6c1)),bnb_price AS (SELECT minute, priceFROM prices.usdCROSS JOIN params pWHERE blockchain = 'bnb'AND contract_address = p.wbnbAND minute >= now() - interval '1' hour * p.hours - interval '5' minute),collector_erc20 AS (SELECTtr.tx_hash,sum(coalesce(tr.amount_usd, 0e0)) AS revenue_usd,count_if(tr.amount_usd IS NULL) AS unpriced_transfers