Query editor
-- q_base_settlement [Base] panel: table / counters-- caption: CallSettled decoded from base.logs by manual byte-slicing. All zeros today — pipeline-ready, not yet live (0 Pact events deploy->47.5M). topic0 + byte offsets verified.-- PACT NETWORK | BASE | Settlement summary from CallSettled (manual byte-slice). 0 events today.WITH settled AS (SELECT l.tx_hash, l.block_time,varbinary_substring(l.topic1, 1, 16) AS call_id,varbinary_substring(l.topic2, 1, 16) AS slug,varbinary_substring(l.topic3, 13, 20) AS agent,varbinary_to_uint256(varbinary_substring(l.data, 1, 32))/1e6 AS premium,varbinary_to_uint256(varbinary_substring(l.data, 33, 32))/1e6 AS refund,varbinary_to_uint256(varbinary_substring(l.data, 65, 32))/1e6 AS actual_refund,varbinary_to_uint256(varbinary_substring(l.data, 97, 32)) AS status,varbinary_to_uint256(varbinary_substring(l.data, 129, 32)) AS breach,varbinary_to_uint256(varbinary_substring(l.data, 161, 32)) AS latency_msFROM base.logs lWHERE l.contract_address = 0x21adb7c1ad28b332661dab8d52d765610dbf162aAND l.topic0 = 0x6884720a8479645f77c753251ab0b8f919333116f952044ef1006b8a237473c5AND l.block_number >= 46880730)SELECTCOALESCE(COUNT(*), 0) AS settled_calls,COALESCE(SUM(premium), 0) AS total_premium_usdc,COALESCE(SUM(actual_refund), 0) AS total_refund_usdc,COALESCE(SUM(premium) - SUM(actual_refund), 0) AS protocol_pnl_usdc,COALESCE(SUM(breach), 0) AS breach_count,COALESCE(COUNT(DISTINCT agent), 0) AS active_agents,COALESCE(COUNT(DISTINCT slug), 0) AS endpoints_touchedFROM settled