Query editor
WITHcombined_calls AS (SELECTcall_block_date,call_tx_from AS user_addressFROMgm_ink.dailygm_call_gmUNION ALLSELECTcall_block_date,call_tx_from AS user_addressFROMgm_ink.dailygm_call_gmto),first_seen AS (SELECTuser_address,MIN(call_block_date) AS first_dateFROMcombined_callsGROUP BYuser_address),cohort_activity AS (SELECTf.first_date,c.call_block_date,COUNT(DISTINCT c.user_address) AS active_usersFROMfirst_seen fLEFT JOIN combined_calls c ON f.user_address = c.user_addressAND c.call_block_date >= f.first_dateGROUP BYf.first_date,c.call_block_date),cohort_sizes AS (SELECTfirst_date,MAX(active_users) AS cohort_sizeFROMcohort_activityWHEREfirst_date = call_block_dateGROUP BYfirst_date),retention_by_day AS (SELECTdate_diff('day', a.first_date, a.call_block_date) AS days_since_first,a.active_users,s.cohort_sizeFROMcohort_activity aJOIN cohort_sizes s ON a.first_date = s.first_dateWHEREa.call_block_date IS NOT NULL)SELECTdays_since_first,