Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/with user_activity as (select evt_block_time, evt_tx_hash, 'maker' as evt_type, maker as userfrom rubicon_optimism.RubiconMarket_evt_LogMake),grouped_user_activity as (select evt_block_time, evt_tx_hash, evt_type, userfrom user_activitygroup by evt_block_time, evt_tx_hash, evt_type, user),aggregated_user_activity as (select user, max(evt_block_time) as most_recent_txn, min(evt_block_time) as first_txn,count(case when evt_type = 'maker' then 1 else null end) as maker_countfrom grouped_user_activitygroup by user)select avg(maker_count) as average_maker_txnsfrom aggregated_user_activity