Query editor
-- D1 fix pass (F-4.3): yield ledger broken down by account, transaction family and month, for Oct 2024 → Aug 2026,-- to name the cause of the months where the Dune ledger and the Steakhouse deck "Invest P&L" differ by more than 3%.-- Same basis as 8164884 / 8821484 (accounts 32321* = investment P&L, 32322* = rewards; one-off Aave USDS LM accrual excluded).-- transaction family = the transaction id with its trailing sequence number removed (e.g. ACCRUAL-GENESIS-SWISEETH-400 -> ACCRUAL-GENESIS-SWISEETH).select date_trunc('month', ts) as month,cast(account as varchar) as account,ledger,regexp_replace(transaction, '-[0-9]+$', '') as tx_family,cast(token_address as varchar) as token,count(*) as n,sum(amount) as amount_usd,sum(token_amount) as token_amount,min(ts) as first_ts, max(ts) as last_tsfrom dune.steakhouse.result_ens_accounting_mainwhere wallet = '0x4f2083f5fbede34c2714affb3105539775f7fe64'and (cast(account as varchar) like '32321%' or cast(account as varchar) like '32322%')and transaction != 'ACCRUAL-LMREWARDS-AETHUSDS-1'and ts >= timestamp '2024-10-01' and ts < timestamp '2026-09-01'group by 1,2,3,4,5order by 1,2,4