Query editor
-- CollateralManager withdraw() Call AnalysisWITH collateral_manager AS (SELECT 0x2C03C7d7e2974C6599b6B108879109281ef3F818 AS address),-- Contract callers: appear as internal traces where from is a contractcontract_interactions AS (SELECTtr."from" AS caller,'Contract' AS caller_type,tr.success,tr.gas_used,tr.block_time,tr.tx_hashFROM rise.traces trJOIN collateral_manager cm ON tr.to = cm.addressWHERE tr.block_time >= NOW() - INTERVAL '90' DAYAND tr.call_type = 'call'AND tr.input IS NOT NULLAND bytearray_substring(tr.input, 1, 4) = 0xd9caed12 -- withdraw()AND tr.trace_address != ARRAY[]),-- EOA callers: appear as top-level transactionseoa_interactions AS (SELECTt."from" AS caller,'EOA' AS caller_type,t.success,t.gas_used,t.block_time,t.hash AS tx_hashFROM rise.transactions tJOIN collateral_manager cm ON t.to = cm.addressWHERE t.block_time >= NOW() - INTERVAL '90' DAYAND t.data IS NOT NULLAND bytearray_substring(t.data, 1, 4) = 0xd9caed12 -- withdraw()),interactions AS (SELECT * FROM contract_interactionsUNION ALLSELECT * FROM eoa_interactions)SELECTcaller,caller_type,COUNT(*) AS call_count,SUM(CASE WHEN success THEN 1 ELSE 0 END) AS successful_calls,AVG(gas_used) AS avg_gas,MIN(block_time) AS first_seen,MAX(block_time) AS last_seenFROM interactionsGROUP BY caller, caller_typeORDER BY call_count DESCLIMIT 1000