Query editor
-- ENS DAO — Working Group safe outflows, external-only (monthly × safe × asset, native units) v1-- Owner: coltron (public). Repo: ens-foundation-skill/pipeline/financials/sql/ens_wg_outflows.sql-- GENERATED by scripts/gen_wg_sql.py from addresses.csv (WG safes + pods; internal set) and counterparties.csv (internal rows).-- Do not edit by hand: rerun gen_wg_sql.py (run_dune.py does this before every wg_outflows run).---- Independent second source for Part A's Level-2 table (wg_flows.py, built from Etherscan txlistinternal/tokentx per safe):-- every successful value transfer OUT of a WG safe or pod to an address OUTSIDE the DAO address set (R1),-- ETH from ethereum.traces, ERC-20 (USDC / USDCx / ENS / WETH / DAI / USDT) from erc20 Transfer events.-- Native units only: USD is applied by the consumer at the same DeFiLlama daily price basis as the Etherscan series, so the-- comparison tests the transfer record, not the price feed. Compared in scripts/dune_wg_check.py (0.5% per safe × year × asset).-- Parameters: {{period_start}} / {{period_end}} (text, 'YYYY-MM-DD'; end exclusive).-- 18 safes/pods, 35 internal addresses excluded.with params as (select timestamp '{{period_start}}' as t0, timestamp '{{period_end}}' as t1),safes as (select * from (values(0x91c32893216de3ea0a55abb9851f581d4503d39b, 'mg-main'),(0xb162bf7a7fd64ef32b787719335d06b2780e31d1, 'mg-2'),(0x4f4cadb8af8f1d463240c2b93952d8a16688a818, 'mg-sub-1'),(0x8f730f4ac5fd234df9993e0e317f07e44fb869c1, 'mg-sub-2'),(0x2686a8919df194aa7673244549e68d42c1685d03, 'eco-main'),(0x536013c57daf01d78e8a70cad1b1abada9411819, 'eco-2'),(0x9b9c249be04dd433c7e8fbbf5e61e6741b89966d, 'eco-3'),(0x13aee52c1c688d3554a15556c5353cb0c3696ea2, 'eco-4'),(0x9718ba71dc1284842fce66dc3e34dffc6c630074, 'eco-5'),(0x6a016548310076285668e2378df70bd545396b5a, 'eco-sub-1'),(0xba0c461b22d918fb1f52fef556310230d177d1f2, 'eco-sub-2'),(0xcd42b4c4d102cc22864e3a1341bb0529c17fd87d, 'pg-main'),(0xeba76c907f02ba13064edad7876fe51d9d856f62, 'pg-2'),(0x69a79128462853833e22bba1a43bcdac4725761b, 'mg-pod-support'),(0x83dd97a584c4ad50015f7aa6b48bf4970a056d8f, 'mg-pod-endowmentfees'),(0xb3a37c813d3d365a03dd1dd3e68cc11af019cdd6, 'mg-pod-bugbounty'),(0x0d06a817584ac378849f03df6f11a9ad67dd786d, 'eco-pod-merch'),(0x5d609c79c7e19aa334d77517b3b17a3dac6f54bc, 'eco-pod-5d609c')) as t(addr, slug)),internal as (select * from (values(0x02d61347e5c6ea5604f3f814c5b5498421cebdeb),(0x0a9387643ce6291f8c545286675d76bcd0ba3edd),(0x0bcc3da6ad796f59288c0961602675e88a2b406c),(0x0d06a817584ac378849f03df6f11a9ad67dd786d),(0x13aee52c1c688d3554a15556c5353cb0c3696ea2),(0x253553366da8546fc250f225fe3d25d0c782303b),(0x2686a8919df194aa7673244549e68d42c1685d03),(0x283af0b28c62c092c9727f1ee09c02ca627eb7f5),(0x323a76393544d5ecca80cd6ef2a560c6a395b7e3),(0x4f2083f5fbede34c2714affb3105539775f7fe64),(0x4f4cadb8af8f1d463240c2b93952d8a16688a818),(0x536013c57daf01d78e8a70cad1b1abada9411819),(0x59e16fccd424cc24e280be16e11bcd56fb0ce547),(0x5d609c79c7e19aa334d77517b3b17a3dac6f54bc),(0x62627681d92e36b9aee1d9a6bf181373ccd42552),(0x69a79128462853833e22bba1a43bcdac4725761b),(0x6a016548310076285668e2378df70bd545396b5a),(0x83dd97a584c4ad50015f7aa6b48bf4970a056d8f),(0x845c6f5599fbb25dbdd1b9b013daf85c03f3c637),(0x8f730f4ac5fd234df9993e0e317f07e44fb869c1),