Query editor
-- Title: Dogstar Platform Monthly Active Accounts (MAA) - Sending Activity (Since Jan 2024)-- Description: Counts the unique Dogstar platform accounts that initiated at least one 'sending' operation per month, starting from January 2024.-- Platform accounts are defined as those created by the Dogstar League or Dogwallet 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) -- Check if funder matches either Dogstar funderWHEREh.type_string = 'create_account' -- Filter for account creation operations),-- Step 2: Find operations initiated by these Dogstar accounts that signify 'sending' activity-- We select distinct account/month pairs because we only need to know *if* an account was active in a monthactive_senders_by_month AS (SELECT DISTINCTh.source_account, -- The account that initiated the operationdate_trunc('month', h.closed_at) AS activity_month -- Determine the month of activityFROM stellar.history_operations hWHERE-- Ensure the operation was initiated by a known Dogstar accounth.source_account IN (SELECT account FROM dogstar_accounts)-- Filter for operation types that represent sending/initiating actionsAND h.type_string IN ('payment', -- Sending XLM or an asset'path_payment_strict_send', -- Sending via a path (defined by send amount)'path_payment_strict_receive', -- Sending via a path (defined by receive amount, but source initiated)'manage_sell_offer', -- Creating/updating/deleting a sell offer'manage_buy_offer', -- Creating/updating/deleting a buy offer'create_passive_sell_offer', -- Creating a passive offer'set_options', -- Setting account flags, inflation dest, home domain, weights, thresholds'change_trust', -- Adding or removing a trustline'account_merge', -- Merging account balance *into* another (source account is removed)'manage_data', -- Adding/updating/deleting data entries'bump_sequence', -- Manually advancing the account's sequence number'create_claimable_balance', -- Creating a balance that needs to be claimed'begin_sponsoring_future_reserves', -- Initiating sponsorship'end_sponsoring_future_reserves', -- Ending sponsorship'revoke_sponsorship', -- Revoking sponsorship (initiated by sponsor or owner)'liquidity_pool_deposit', -- Depositing into a liquidity pool'liquidity_pool_withdraw', -- Withdrawing from a liquidity pool'invoke_host_function' -- Interacting with a Soroban smart contract)-- Filter for activity from Jan 2024 onwards <<-- FILTER ADDED HEREAND h.closed_at >= date '2024-01-01')-- Step 3: Count the number of unique active accounts for each monthSELECT