Query editor
-- Title: Dogstar Platform Weekly Active Accounts (WAA) - Sending Activity (Since Jan 2024)-- Description: Counts the unique Dogstar platform accounts that initiated at least one 'sending' operation per week, starting from January 2024. Platform accounts are defined as those created by the Dogstar League ('GDBS...SBW') or Dogwallet ('GDYA...VC3R') funders. 'Sending' operations include payments, trades, managing offers/trustlines/data, pool interactions, contract calls, etc. It excludes purely passive actions like receiving payments ('account_credited' effect). Weeks start based on the system's default (often Monday).WITHparams AS (SELECT'GDBSXMDBDHVZ3OMNQWV5MMNPMPOJRZAGEAOVRYWXZG5VC5I5B4SOXSBW' AS league_funder,'GDYAPTNACFQVAPUCD6LIV3RK75ERETZAID6KAN6K6NCPLEOBUCWPVC3R' AS dogwallet_funder),-- Step 1: Identify all unique accounts created by the Dogstar fundersdogstar_accounts AS (SELECT DISTINCTh.account -- The account address that was createdFROM stellar.history_operations hJOIN params p ON h.funder IN (p.league_funder, p.dogwallet_funder)WHEREh.type_string = 'create_account'),-- Step 2: Find 'sending' operations initiated by these accounts, aggregate by weekactive_senders_by_week AS (SELECT DISTINCTh.source_account,date_trunc('week', h.closed_at) AS activity_week -- Aggregate by week <<-- MODIFIED HEREFROM stellar.history_operations hWHEREh.source_account IN (SELECT account FROM dogstar_accounts)AND h.type_string IN ('payment', 'path_payment_strict_send', 'path_payment_strict_receive','manage_sell_offer', 'manage_buy_offer', 'create_passive_sell_offer','set_options', 'change_trust', 'account_merge', 'manage_data','bump_sequence', 'create_claimable_balance','begin_sponsoring_future_reserves', 'end_sponsoring_future_reserves','revoke_sponsorship', 'liquidity_pool_deposit', 'liquidity_pool_withdraw','invoke_host_function')AND h.closed_at >= date '2024-01-01' -- Filter for activity from Jan 2024 onwards)-- Step 3: Count the number of unique active accounts for each weekSELECTactivity_week,COUNT(source_account) AS weekly_active_sending_accounts -- <<-- MODIFIED HEREFROM active_senders_by_weekGROUP BYactivity_weekORDER BYactivity_week DESC -- Display results with the most recent week first