near-toll-audit / pipeline/sql/18_treasury_outflows.sql · raw
-- Where the NEAR that left treasury.near went. The two days come from its balance history in raw/latest/wallet_history.SELECT block_date, receipt_receiver_account_id AS receiver, COUNT(*) AS transfers,       SUM(SAFE_CAST(JSON_VALUE(args, '$.deposit') AS BIGNUMERIC)) / 1e24 AS nearFROM `bigquery-public-data.crypto_near_mainnet_us.receipt_actions`WHERE block_date IN ('2026-04-15', '2026-05-13') AND receipt_predecessor_account_id = 'treasury.near' AND action_kind = 'TRANSFER'GROUP BY 1, 2ORDER BY 1, 4 DESC