Query editor
WITH contract_txns AS (SELECT DISTINCT ho.transaction_idFROM stellar.history_operations hoWHERE ho.contract_id IN ('CBTWKH2SZKZAT3AWASDL4GPMGLA4IVGO6ALNVAXERC57GWLQKVW426T7','CAZB2F2GXXDTDZHY55K736BIEJVUYV6UYMKPZUW2VTSIJI3JL4NV42FC','CA4KMAVQYUCKGS6C74HWN4M2VOLZJUAPK3DTHB5XJSHYAWHGLKJZYKDH','CDYARP72VYRQDUBGGPTLCSR2CTMSUFTBWAV56OZTPYJZNSIIZYOT4NAY','CCPNPQ2OPPDOQXTKO43PO4GOFINLMUHTGHG7D7G4M6PWHF3TYAUQCWUW','CA4KMAVQYUCKGS6C74HWN4M2VOLZJUAPK3DTHB5XJSHYAWHGLKJZYKDH')),tx_sources AS (SELECTDATE_TRUNC('month', ht.closed_at) AS month,ht.account AS wallet_addressFROM stellar.history_transactions htJOIN contract_txns ct ON ht.id = ct.transaction_idWHERE ht.closed_at >= CURRENT_TIMESTAMP - INTERVAL '6' MONTH),monthly_active_users AS (SELECTmonth,COUNT(DISTINCT wallet_address) AS unique_active_walletsFROM tx_sourcesGROUP BY month),cumulative_active_users AS (SELECTmonth,unique_active_wallets,SUM(unique_active_wallets) OVER (ORDER BY month) AS cumulative_unique_active_walletsFROM monthly_active_users)SELECTmonth,unique_active_wallets,cumulative_unique_active_walletsFROM cumulative_active_usersORDER BY month;