Query editor
-- Title: Dogstar Platform Daily Active Accounts (DAA) - Sending Activity (Since Jan 2024)-- Description: Counts the unique Dogstar platform accounts that initiated at least one 'sending' operation per day, 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).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 dayactive_senders_by_day AS (SELECT DISTINCTh.source_account,date_trunc('day', h.closed_at) AS activity_day -- Aggregate by day <<-- MODIFIED HERE-- Alternatively: CAST(h.closed_at AS date) AS activity_dayFROM 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 daySELECTactivity_day,COUNT(source_account) AS daily_active_sending_accounts -- <<-- MODIFIED HEREFROM active_senders_by_dayGROUP BYactivity_dayORDER BYactivity_day DESC -- Display results with the most recent day first