Query editor
WITH first_appearance AS (SELECTmaker,date_trunc('month', evt_block_time) AS first_active_monthFROM probable_v1_bnb.ctfexchange_evt_orderfilledGROUP BY maker,date_trunc('month', evt_block_time)),monthly_stats AS (SELECTdate_trunc('month', evt_block_time) AS month,COUNT(DISTINCT evt_tx_hash) AS unique_ctf_txns,COUNT(DISTINCT maker) AS unique_ctf_mau,ROUND(COUNT(DISTINCT evt_tx_hash)*1.0 / NULLIF(COUNT(DISTINCT maker), 0), 2) AS txn_user_ratio,COUNT(DISTINCT evt_tx_from) AS unique_tx_from,COUNT(maker) AS ctf_mauFROM probable_v1_bnb.ctfexchange_evt_orderfilledGROUP BY 1),monthly_new_users AS (SELECTfirst_active_month AS month,COUNT(DISTINCT maker) AS new_mauFROM first_appearanceGROUP BY first_active_month)SELECTms.month,ms.unique_ctf_txns,ms.unique_ctf_mau,ms.txn_user_ratio,ms.unique_tx_from,ms.ctf_mau,COALESCE(mnu.new_mau, 0) AS new_mauFROM monthly_stats msLEFT JOIN monthly_new_users mnu ON ms.month = mnu.monthORDER BY ms.month DESC;